Last active
January 9, 2025 19:54
-
-
Save airbornelamb/a51b38a17b943753cacbd2821433813c to your computer and use it in GitHub Desktop.
dynu updater script to add to crontab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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