From 5fe796f141259d49452713a85aaa117d73eead5a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 1 Mar 2017 12:39:25 +0100 Subject: can now update multiple ips at once --- update-ddns.in | 20 ++++++++++---------- 1 file 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 -- cgit v1.2.3-70-g09d2