#!/usr/bin/env bash

set -Eeuo pipefail

systemctl is-active --quiet haproxy.service
/usr/local/haproxy/sbin/haproxy -c -f /etc/haproxy/haproxy.cfg >/dev/null 2>&1
listeners=$(ss -H -lnt | awk '{print $4}')
grep -Eq '(^|:)1883$' <<<"$listeners"
grep -Eq '(^|:)8083$' <<<"$listeners"
