add ddns helper script
This commit is contained in:
parent
3393073cd3
commit
69ced53a26
1 changed files with 18 additions and 0 deletions
18
bin/ddns
Executable file
18
bin/ddns
Executable 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"
|
Loading…
Add table
Add a link
Reference in a new issue