Update your dyndns using wget

Please post any helpful and useful tips to maximize your fellow ReadyNAS users' experience.

Update your dyndns using wget

Postby LrdShaper » Mon Feb 04, 2008 12:55 am

For those whose router does not support dyndns like me. I've had this script on my NSLU2 running unslung firmware for years. i've tested the same script on the readynas just to see if it works and it does.
if you're having problems with the web ui like i am, this can be an alternative to using backup functionality to update dyndns
First you must already be running raidiator v4 and able to login as root via ssh.

open a file using vi
Code: Select all
vi foobar

and paste the ff code:
Code: Select all
#!/bin/bash
wget -q http://checkip.dyndns.com:8245/index.html --output-document=/var/tmp/new.ip
if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
   then echo;
   rm -f /var/tmp/new.ip
else wget -q http://USERNAME:PASSWORD@members.dyndns.org:8245/nic/update?hostname=YOURDYNDNS.ADDRESS.ORG --output-document=/var/tmp/upd.ip
   rm -f /var/tmp/old.ip /var/tmp/upd.ip
   mv /var/tmp/new.ip /var/tmp/old.ip
fi

replace
USERNAME = dyndns username
PASSWORD = dyndns password
YOURDYNDNS.ADDRESS.ORG = dyndns address (ie infrant.kicks-@$$.org)

make the script executable
Code: Select all
chmod 700 foobar

you may want to put the script in cron and have it run once a day. if you want it to run on boot-up place the script in /etc/init.d

the script was taken from http://www.nslu2-linux.org and not created by me. cheers!
User avatar
LrdShaper
ReadyNAS Expert
 
Posts: 223
Joined: Sun Dec 16, 2007 7:08 pm
Location: ::1
ReadyNAS: Repertoire

Re: Update your dyndns using wget

Postby btaroli » Tue Apr 01, 2008 12:42 pm

I didn't see this until now, but 'tis sweet. :) thanks
User avatar
btaroli
Advanced ReadyNAS Expert
 
Posts: 759
Joined: Wed Dec 05, 2007 6:23 pm
Location: SF Bay Area, CA
ReadyNAS: Pro


Return to User Submitted Tips



Who is online

Users browsing this forum: No registered users and 1 guest