From 62778e530b38c37b12e8576d69eb478eed2b4e88 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 23 Feb 2017 12:11:49 +0100 Subject: disable automativ ip detection if possible, actually update instead of printing ;-) --- update-ddns.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/update-ddns.in b/update-ddns.in index da7facd..b8542b8 100644 --- a/update-ddns.in +++ b/update-ddns.in @@ -47,6 +47,7 @@ do curl -${ipVer} "${dev}" 2> /dev/null )" ips="1" + unset updateIp else dnsIps="$( dig "${dnsName}" ${dnsVer} | \ @@ -63,6 +64,13 @@ do cut -d/ -f1 | \ sort -u )" + + if [ $(echo "${ips}" | wc -l) -eq 1 ] + then + updateIp='?address='"${ips}" + else + unset updateIp + fi fi if [ -z "$( @@ -74,7 +82,7 @@ do uniq -d )" ] then - echo curl -sS "https://${syncPre}sync.afraid.org/u/${authToken}/" + curl -sS "https://${syncPre}sync.afraid.org/u/${authToken}/${updateIp}" 2> /dev/null fi done < #ETCDIR#/update-ddns.conf -- cgit v1.2.3-54-g00ecf