diff options
author | Erich Eckner <git@eckner.net> | 2017-02-26 19:38:58 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-02-26 19:38:58 +0100 |
commit | dcf8ba72b0b3b68e011775977cbda00c0add84ef (patch) | |
tree | 66b94c2e84182f998087d68b847e69dd107e1408 /update-ddns.in | |
parent | 1eb6985c1f2970bc157d8a25139285518127a027 (diff) | |
download | update-ddns-dcf8ba72b0b3b68e011775977cbda00c0add84ef.tar.xz |
kann jetzt auch andere urls als freedns.afraid.org syncen
Diffstat (limited to 'update-ddns.in')
-rw-r--r-- | update-ddns.in | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/update-ddns.in b/update-ddns.in index 4779654..6626ed4 100644 --- a/update-ddns.in +++ b/update-ddns.in @@ -18,24 +18,22 @@ then done fi -while read -r ipVer authToken dev dnsName +while read -r ipVer updateUrl dev dnsName do - if [[ "${ipVer}" = "#"* ]] || [ -z "${ipVer}" ] + if [[ "${ipVer}" = '#'* ]] || [ -z "${ipVer}" ] then continue fi - if [ ${ipVer} == "4" ] + if [ "${ipVer}" == "4" ] then dnsVer="A" inetVer="inet" - syncPre="" - elif [ ${ipVer} == "6" ] + elif [ "${ipVer}" == "6" ] then dnsVer="AAAA" inetVer="inet6" - syncPre="v6." else >&2 echo 'Error: First column in "#ETCDIR#/update-ddns.conf" needs to be "4" or "6"!' exit 1 @@ -67,7 +65,13 @@ do if [ $(echo "${ips}" | wc -l) -eq 1 ] then - updateIp='?address='"${ips}" + updateIp='address='"${ips}" + if [[ "${updateUrl}" = *'?'* ]] + then + updateIp='&'"${updateIp}" + else + updateIp='?'"${updateIp}" + fi else unset updateIp fi @@ -82,7 +86,7 @@ do uniq -d )" ] then - curl -${ipVer} -sS "https://${syncPre}sync.afraid.org/u/${authToken}/${updateIp}" 2> /dev/null + curl -${ipVer} -sS "${updateUrl}${updateIp}" 2> /dev/null fi done < #ETCDIR#/update-ddns.conf |