From 9f1bc8f0fb9c6f52af7c954005c1bb5a2697f2e8 Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Sat, 20 Dec 2025 12:40:19 +0800 Subject: [PATCH] fix(frigg): ddns get ip --- tools/frigg-client.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/frigg-client.sh b/tools/frigg-client.sh index f717f6b..713ebac 100755 --- a/tools/frigg-client.sh +++ b/tools/frigg-client.sh @@ -99,7 +99,7 @@ update_dns() elif [[ "$DFS_DDNS_IP4" == "http"* ]]; then ip4=$(curl $DFS_CURL_OPTIONS -sSL "$DFS_DDNS_IP4") else - ip4=$(ip a show $DFS_DDNS_IP4 | grep inet | grep global | awk '/inet / {print $2}' | awk -F'[/]' '{print $1}') + ip4=$(ip -4 --brief addr show $DFS_DDNS_IP4 scope global primary | awk '{split($3,a,"/");print a[1]}' | head -n 1) fi if [[ -n "$DFS_DDNS_IP4" && -z "$ip4" ]]; then fmt_fatal "failed getting ip4 address" @@ -115,7 +115,7 @@ update_dns() elif [[ "$DFS_DDNS_IP6" == "http"* ]]; then ip6=$(curl $DFS_CURL_OPTIONS -sSL "$DFS_DDNS_IP6") else - ip6=$(ip a show $DFS_DDNS_IP6 | grep inet6 | grep global | awk '/inet6 / {print $2}' | awk -F'[/]' '{print $1}') + ip6=$(ip -6 --brief addr show $DFS_DDNS_IP6 scope global primary | awk '{split($3,a,"/");print a[1]}' | head -n 1) fi if [[ -n "$DFS_DDNS_IP6" && -z "$ip6" ]]; then fmt_fatal "failed getting ip6 address"