diff options
author | TomTurnschuh <36013390+TomTurnschuh@users.noreply.github.com> | 2018-10-07 18:24:38 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-10-07 18:24:38 +0300 |
commit | c6da8a9c565675085b5b1ab6ce8f5f19ff88f2fb (patch) | |
tree | 94baca41ce46c0062f70c540bb7578db53acd3b1 | |
parent | 54e09689ce236b4e55bfbc60f8184a158eac415f (diff) |
Use DIG instead of NSLOOKUP in DDNS apps (#666)v0.62.8
-rw-r--r-- | etc/ncp-config.d/DDNS_freeDNS.sh | 2 | ||||
-rw-r--r-- | etc/ncp-config.d/DDNS_spDYN.sh | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/etc/ncp-config.d/DDNS_freeDNS.sh b/etc/ncp-config.d/DDNS_freeDNS.sh index 9c77ae5f..713bda20 100644 --- a/etc/ncp-config.d/DDNS_freeDNS.sh +++ b/etc/ncp-config.d/DDNS_freeDNS.sh @@ -34,7 +34,7 @@ configure() #!/bin/bash echo "FreeDNS client started" echo "${URL}" -registeredIP=\$(nslookup ${DOMAIN_}|tail -n2|grep A|sed s/[^0-9.]//g) +registeredIP=$(dig +short "$DOMAIN_"|tail -n1) currentIP=\$(wget -q -O - http://checkip.dyndns.org|sed s/[^0-9.]//g) [ "\$currentIP" != "\$registeredIP" ] && { wget -q -O /dev/null ${URL} diff --git a/etc/ncp-config.d/DDNS_spDYN.sh b/etc/ncp-config.d/DDNS_spDYN.sh index c1736329..2491a749 100644 --- a/etc/ncp-config.d/DDNS_spDYN.sh +++ b/etc/ncp-config.d/DDNS_spDYN.sh @@ -87,7 +87,7 @@ if [ $# -eq 3 ] then # if hostname and token # Get registered IP address - registeredIP=\$(nslookup ${DOMAIN_}|tail -n2|grep A|sed s/[^0-9.]//g) + registeredIP=$(dig +short "$DOMAIN_"|tail -n1) # Get current IP address currip=$(curl -s "$get_ip_url"); # Update only when IP address has changed. @@ -102,7 +102,7 @@ if [ $# -eq 3 ] then # if hostname and user and passwd # Get registered IP address - registeredIP=\$(nslookup ${DOMAIN_}|tail -n2|grep A|sed s/[^0-9.]//g) + registeredIP=$(dig +short "$DOMAIN_"|tail -n1) # Get current IP address currip=$(curl -s "$get_ip_url"); # Update only when IP address has changed. |