summaryrefslogtreecommitdiff
path: root/update-ddns.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-02-23 12:11:49 +0100
committerErich Eckner <git@eckner.net>2017-02-23 12:11:49 +0100
commit62778e530b38c37b12e8576d69eb478eed2b4e88 (patch)
treef9c93d2eb5bf27b5026eaf872e508d6b0bf6b5c8 /update-ddns.in
parent688ae0119124d48dfe0dca364aa3f519804fec84 (diff)
downloadupdate-ddns-62778e530b38c37b12e8576d69eb478eed2b4e88.tar.xz
disable automativ ip detection if possible, actually update instead of printing ;-)v0.0
Diffstat (limited to 'update-ddns.in')
-rw-r--r--update-ddns.in10
1 files changed, 9 insertions, 1 deletions
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