summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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