add ddns helper script

This commit is contained in:
Tim Schubert 2021-05-02 16:31:17 +02:00
parent 3393073cd3
commit 69ced53a26
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA

18
bin/ddns Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -e
set -u
set -x
function url() {
echo "https://svc.joker.com/nic/update?username=$1&password=$2&hostname=$3"
}
IFS=':'
read -r user password < "${DDNS_CREDENTIALS:-/var/lib/ddns/credentials}"
unset IFS
curl_url=$(url "$user" "$password" bs.vpn.dadada.li)
curl -4 "$curl_url"
curl -6 "$curl_url"