Home » Questions » Computers [ Ask a new question ]

Dynamic DNS update script for a DDWRT router - Help with scripting needed

Dynamic DNS update script for a DDWRT router - Help with scripting needed

"I'm running a WRT54GL with DD WRT, and having my domain hosted at zoneedit. For some reason, automatic dynamic DNS clients don't seem to work- they get the ipaddress of what i believe is a proxy server., so i want to throw together a script. In short i need to strip out the ipaddress from the output of ifconfig vlan1 (since vlan1 is the adaptor that's connected to my modem (grep gets me halfway there) and get it into a URL similar to
'wget -O - --http-user=username --http-passwd=password 'http://dynamic.zoneedit.com/auth/dynamic.html?host=mail.myzone.com&dnsto=myipaddress '"

Asked by: Guest | Views: 23
Total answers/comments: 1
Guest [Entry]

"This should extract your IP address:

ifconfig vlan1 | grep ""inet addr"" | cut -d: -f2 | cut -d"" "" -f1

if you want to save it to a variable:

ip=$(ifconfig vlan1 | grep ""inet addr"" | cut -d: -f2 | cut -d"" "" -f1)

then throw it into your command:

wget -O - --http-user=username --http-passwd=password ""http://dynamic.zoneedit.com/auth/dynamic.html?host=mail.myzone.com&dnsto=$ip""

ifconfig, grep, and cut are available on BusyBox."