Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
dynu updater script to add to crontab
#!/bin/sh
#
# https://www.dynu.com/en-US/DynamicDNS/IP-Update-Protocol
# Hash password at https://www.dynu.com/NetworkTools/Hash
# DON'T FORGET TO ADD TO CRONTAB and CHMOD 700
# ex.. @hourly /home/user/path/to/script
mkdir -p $HOME/dynu
command -v wget >/dev/null 2>&1 || { echo "I require wget but it's not installed." >&2; }
USERNAME=ENTERUSERNAME
PASSWORD=ENTERHASHEDPASSWORD
URL="https://api.dynu.com/nic/update?username=${USERNAME}&password=${PASSWORD}"
ANSWER=$(wget -q -O - "$URL")
NOW=$(date +%F_%R)
printf "$NOW $ANSWER \n" >> $HOME/dynu/dynu.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment