From 69ced53a26d920fa105a0f2f6e68b7adf9f0567a Mon Sep 17 00:00:00 2001 From: dadada Date: Sun, 2 May 2021 16:31:17 +0200 Subject: [PATCH] add ddns helper script --- bin/ddns | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 bin/ddns diff --git a/bin/ddns b/bin/ddns new file mode 100755 index 0000000..3b90fe4 --- /dev/null +++ b/bin/ddns @@ -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"