summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--update-ddns.in20
1 files changed, 10 insertions, 10 deletions
diff --git a/update-ddns.in b/update-ddns.in
index a6dea00..0fb993e 100644
--- a/update-ddns.in
+++ b/update-ddns.in
@@ -26,15 +26,15 @@ do
continue
fi
- if [ "${ipVer}" == "4" ]
+ if [ "${ipVer}" == '4' ]
then
- dnsVer="A"
- inetVer="inet"
+ dnsVer='A'
+ inetVer='inet'
ipCmdVer='-4'
- elif [ "${ipVer}" == "6" ]
+ elif [ "${ipVer}" == '6' ]
then
- dnsVer="AAAA"
- inetVer="inet6"
+ dnsVer='AAAA'
+ inetVer='inet6'
ipCmdVer='-6'
else
>&2 echo 'Error: First column in "#ETCDIR#/update-ddns.conf" needs to be "4" or "6"!'
@@ -71,17 +71,17 @@ do
sort -u
)"
- if [ $(echo "${ips}" | wc -l) -eq 1 ]
+ if [ $(echo "${ips}" | wc -l) -eq 0 ]
then
- updateIp='address='"${ips}"
+ unset updateIp
+ else
+ updateIp='address='"$(echo -n "${ips}" | tr '\n' ',')"
if [[ "${updateUrl}" = *'?'* ]]
then
updateIp='&'"${updateIp}"
else
updateIp='?'"${updateIp}"
fi
- else
- unset updateIp
fi
fi