From b6fe97650c7b917267fc4a454b67d8405884f482 Mon Sep 17 00:00:00 2001 From: Vigilans Date: Sun, 11 Sep 2022 15:39:20 +0800 Subject: [PATCH] Fix no "-4" and "-6" parameter when using busybox wget --- ardnspod | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ardnspod b/ardnspod index 856fa64..17f6126 100644 --- a/ardnspod +++ b/ardnspod @@ -90,8 +90,10 @@ arWanIp6() { if [ -z "$hostIp" ]; then if type curl >/dev/null 2>&1; then hostIp=$(curl -6 -s $arIp6QueryUrl) - else + elif ! wget --help 2>&1 | grep -qs BusyBox; then hostIp=$(wget -6 -q -O- $arIp6QueryUrl) + else + hostIp=$(wget -q -O- $arIp6QueryUrl) fi fi @@ -121,8 +123,10 @@ arDdnsApi() { if type curl >/dev/null 2>&1; then curl -4 -s -A $agent -d $params $dnsapi - else + elif ! wget --help 2>&1 | grep -qs BusyBox; then wget -4 -q -O- --no-check-certificate -U $agent --post-data $params $dnsapi + else + wget -q -O- --no-check-certificate -U $agent --post-data $params $dnsapi fi }