From f2ea372742e071dafe012fdcbfe5b5fba23328e0 Mon Sep 17 00:00:00 2001 From: yukkop Date: Mon, 27 Apr 2026 17:28:01 +0000 Subject: [PATCH] =?UTF-8?q?debug(`package`):=20`sentin=C3=A8lla`:=20surfac?= =?UTF-8?q?e=20host(1)=20and=20SRV-parse=20failures=20in=20watcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/sentinèlla/watcher.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/package/sentinèlla/watcher.sh b/package/sentinèlla/watcher.sh index 96729b1..2f099aa 100644 --- a/package/sentinèlla/watcher.sh +++ b/package/sentinèlla/watcher.sh @@ -82,8 +82,17 @@ is_local_ip() { resolve_peers() { # host -t SRV output: # has SRV record . - host -t SRV "$PEERS_SRV" 2>/dev/null \ - | awk '/has SRV record/ { sub(/\.$/, "", $NF); print $(NF-1), $NF }' \ + _srv_out=$(host -t SRV "$PEERS_SRV" 2>&1) || { + log warn "host -t SRV ${WHITE}${PEERS_SRV}${NC} failed: ${_srv_out}" + return 0 + } + _parsed=$(printf '%s\n' "$_srv_out" \ + | awk '/has SRV record/ { sub(/\.$/, "", $NF); print $(NF-1), $NF }') + if [ -z "$_parsed" ]; then + log warn "no SRV records parsed; raw output: ${_srv_out}" + return 0 + fi + printf '%s\n' "$_parsed" \ | while IFS=' ' read -r port target; do [ -n "$target" ] || continue ip=$(getent hosts "$target" | awk '{print $1; exit}')