Last active
December 10, 2021 00:51
-
-
Save francoisjacques/bd309ab919c7d88b82f0 to your computer and use it in GitHub Desktop.
dns-o-matic client for asuswrt
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 | |
# Typical location - /jffs/scripts/ddns-start | |
# NOTE - USERNAME and PASSWORD must be URL encoded, example @ becomes %40 | |
USERNAME=CHANGE_ME_URL_ENCODED | |
PASSWORD=CHANGE_ME_URL_ENCODED | |
HOSTNAME=all.dnsomatic.com | |
IP=`curl --silent http://canhazip.com` | |
# Should be no need to modify anything beyond this point | |
/usr/sbin/curl --silent "https://$USERNAME:$PASSWORD@updates.dnsomatic.com/nic/update?hostname=$HOSTNAME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=$IP" > /dev/null | |
if [ $? -eq 0 ]; then | |
/sbin/ddns_custom_updated 1 | |
else | |
/sbin/ddns_custom_updated 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Variation on a DDNS script found on asuswrt-merlin
The original didn't specify the IP address to be used by the DNS provider. This version leverages canhazip service to retrieve the real IP address.
Remarks:
chmod u+x /jffs/scripts/ddns-start
)> /dev/null
on line 10 and run the script manually. You should have agood
answer if the credentials were properly provided, then put back the> /dev/null
vim scp://my_router_ip_address//jffs/scripts/ddns-start