Skip to content

Instantly share code, notes, and snippets.

@greysAcademicCode
Last active July 10, 2023 15:26
Show Gist options
  • Save greysAcademicCode/dc0b07e4c40d91884738 to your computer and use it in GitHub Desktop.
Save greysAcademicCode/dc0b07e4c40d91884738 to your computer and use it in GitHub Desktop.
Google Domains DDNS registration script
#!/bin/sh
# see: https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS#google-domains
# this script could go into /jffs/scripts of a router running Merlin's asus-wrt firmware
# you must then choose the "Custom" option for DDNS in the router's web interface
# it registers the WAN IP of the router with Google Domains' DDNS system
# get your login info from yout Google Domains dashboard
IP=$1
USER=
PASS=
DOMAIN=
HOST=
curl https://$USER:[email protected]/nic/update?hostname=$HOST.$DOMAIN
if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
echo "DDNS update done."
else
/sbin/ddns_custom_updated 0
echo "DDNS update failed."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment