Skip to content

Instantly share code, notes, and snippets.

@airbornelamb
Last active May 30, 2018 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save airbornelamb/a51b38a17b943753cacbd2821433813c to your computer and use it in GitHub Desktop.
Save airbornelamb/a51b38a17b943753cacbd2821433813c to your computer and use it in GitHub Desktop.
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