From 62757df3845cb99f802129f0479c917050c81bab Mon Sep 17 00:00:00 2001 From: yukkop Date: Mon, 27 Apr 2026 17:30:01 +0000 Subject: [PATCH] =?UTF-8?q?fix(`package`):=20`sentin=C3=A8lla`:=20use=20di?= =?UTF-8?q?g(1)=20instead=20of=20host(1)=20which=20is=20not=20in=20bind.dn?= =?UTF-8?q?sutils?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/sentinèlla/watcher.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/package/sentinèlla/watcher.sh b/package/sentinèlla/watcher.sh index 2f099aa..bc779ad 100644 --- a/package/sentinèlla/watcher.sh +++ b/package/sentinèlla/watcher.sh @@ -80,14 +80,13 @@ is_local_ip() { # resolve_peers — SRV-resolves PEERS_SRV, then A-resolves each target. # Emits "host port ip" per non-local peer, one per line. resolve_peers() { - # host -t SRV output: - # has SRV record . - _srv_out=$(host -t SRV "$PEERS_SRV" 2>&1) || { - log warn "host -t SRV ${WHITE}${PEERS_SRV}${NC} failed: ${_srv_out}" + # dig +short SRV output: " ." + _srv_out=$(dig +short +time=3 +tries=2 SRV "$PEERS_SRV" 2>&1) || { + log warn "dig 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 }') + | awk 'NF==4 { sub(/\.$/, "", $4); print $3, $4 }') if [ -z "$_parsed" ]; then log warn "no SRV records parsed; raw output: ${_srv_out}" return 0