Last active
November 22, 2022 02:00
-
-
Save eritpchy/775d0adb8b8b8e4293ffa84bb6e9546a to your computer and use it in GitHub Desktop.
asus_ddns.sh wan_start or crontab
This file contains hidden or 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 | |
server=`nvram get ddns_server_x` | |
hostname=`nvram get ddns_hostname_x` | |
wanip=`nvram get wan0_ipaddr` | |
wanoldip=`nvram get wan0_realip_ip` | |
nasserver="nwsrv-ns1.asus.com" | |
postexe="/sbin/ddns_updated" | |
cachefile="/tmp/ddns.cache" | |
#get real ip | |
getrealip.sh >& /dev/null | |
wanip=`nvram get wan0_realip_ip` | |
echo wanip: $wanip | |
echo hostname: $hostname | |
if [ "$1" != "" ] || [ "$wanoldip" != "$wanip" ] | |
then | |
if [ "$server" == "WWW.ASUS.COM" ] | |
then | |
ez-ipupdate -S "dyndns" -a $wanip -h $hostname -A 2 -s $nasserver -e $postexe -b $cachefile | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment