diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-03-17 02:16:33 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-03-17 02:16:37 +0300 |
commit | ec66e40b705bace28d8ee54961ae33f7e627ed13 (patch) | |
tree | e7a561d724f0b14675d674bca6c6f25c0e07479e /bin/ncp | |
parent | 311ccc76ab487ba98b3c62b67af0992c479aed3d (diff) |
freeDNS: fix hashv1.10.2
Diffstat (limited to 'bin/ncp')
-rw-r--r-- | bin/ncp/NETWORKING/freeDNS.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/ncp/NETWORKING/freeDNS.sh b/bin/ncp/NETWORKING/freeDNS.sh index 92699de4..31ba44cd 100644 --- a/bin/ncp/NETWORKING/freeDNS.sh +++ b/bin/ncp/NETWORKING/freeDNS.sh @@ -7,9 +7,6 @@ # -UPDATEURL=https://freedns.afraid.org/dynamic/update.php -URL="${UPDATEURL}?${UPDATEHASH}" - install() { apt-get update @@ -18,6 +15,9 @@ install() configure() { + local updateurl=https://freedns.afraid.org/dynamic/update.php + local url="${updateurl}?${UPDATEHASH}" + [[ $ACTIVE != "yes" ]] && { rm -f /etc/cron.d/freeDNS service cron restart @@ -28,11 +28,11 @@ configure() cat > /usr/local/bin/freedns.sh <<EOF #!/bin/bash echo "FreeDNS client started" -echo "${URL}" -registeredIP=$(dig +short "$DOMAIN"|tail -n1) +echo "${url}" +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} + wget -q -O /dev/null ${url} } echo "Registered IP: \$registeredIP | Current IP: \$currentIP" EOF |