-
-
Save lira/c89a4a294329a17561bdd0ab8b9becaa to your computer and use it in GitHub Desktop.
Google Domains DDNS registration script
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 | |
# 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:$PASS@domains.google.com/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