Skip to content

Instantly share code, notes, and snippets.

Forked from ql-owo-lp/ddns-start
Created July 12, 2020 12:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# register a subdomain at to get your token
# put 'hostname|token' in the 'Host Name' field under DDNS
# e.g. myhost|abcdefgh-1234-5678-9876-f71b0ed7a7fe
DDNS_HOSTNAME_FIELD=$(nvram get ddns_hostname_x)
SUBDOMAIN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $1}')
TOKEN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $2}')
IPV4=$(nvram get wan0_ipaddr)
IPV6=$(nvram get ipv6_wan_addr | awk -F'/' '{print $1}')
logger "DDNS Request URL: ${REQUEST_URL}"
# no modification below needed
RESULT=$(curl --silent "${REQUEST_URL}" 2>&1)
logger "DDNS Request result: $RESULT"
if [[ "$RESULT" == "OK" ]];
/sbin/ddns_custom_updated 1
/sbin/ddns_custom_updated 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment