diff options
author | Erich Eckner <git@eckner.net> | 2017-03-01 12:39:25 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-03-01 12:39:25 +0100 |
commit | 5fe796f141259d49452713a85aaa117d73eead5a (patch) | |
tree | 699e65ac9dedce552f5906cd8db67b7cc36519ea | |
parent | 2eda9af169c948e8c1eca88c1f1743c924fe22da (diff) | |
download | update-ddns-5fe796f141259d49452713a85aaa117d73eead5a.tar.xz |
can now update multiple ips at once
-rw-r--r-- | update-ddns.in | 20 |
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 |