NSLU2-Linux
view · edit · print · history

HowTo.DynDNSupdate History

Hide minor edits - Show changes to markup

November 20, 2008, at 10:10 AM by Krzysztof Sokol --
Changed lines 1120-1172 from:

SRS 07/06/2008

20/11/2008

The easiest way for me was to create an account on www.dyndns.com website, create host service, and then go to Support/Tools and generate a config file for ddclient. If you do that everything else is just a piece of cake, even for a newebee like me, copy all the script informations to /opt/etc/ddclient/ddclient.conf:

  1. nano /opt/etc/ddclient/ddclient.conf

,example of ddclient.conf:

  1. ddclient configuration file

daemon=600 # check every 600 seconds syslog=yes # log update msgs to syslog mail-failure=xxx@xxx.xxx # Mail failed updates to user pid=/var/run/ddclient.pid # record PID in file. ssl=yes # enables ssl

  1. Detect IP with our CheckIP? server

use=web, web=checkip.dyndns.com/, web-skip='IP Address'

  1. DynDNS username and password here

login=xxx password=xxx

  1. Default options

protocol=dyndns2 server=members.dyndns.org

  1. Dynamic DNS hosts

xxx.dynalias.com

save all changes, then edit rc.xinetd your autostart script:

  1. nano /unslung/rc.xinetd

and add lines:

  1. DynDNS Client

if [ -n "`pidof ddclient`" ]; then

   kill -9 `pidof ddclient`

fi

ddclient

Save all changes and it's done, you have ddclient up and running next time you restart your box or if you just load rc.xinetd once again! Do not forget to make it executable:

  1. chmod 755 /unslung/rc.xinetd

Krzysztof Sokol

to:

SRS 07/06/2008

November 20, 2008, at 10:08 AM by Krzysztof Sokol --
Added lines 1122-1172:

20/11/2008

The easiest way for me was to create an account on www.dyndns.com website, create host service, and then go to Support/Tools and generate a config file for ddclient. If you do that everything else is just a piece of cake, even for a newebee like me, copy all the script informations to /opt/etc/ddclient/ddclient.conf:

  1. nano /opt/etc/ddclient/ddclient.conf

,example of ddclient.conf:

  1. ddclient configuration file

daemon=600 # check every 600 seconds syslog=yes # log update msgs to syslog mail-failure=xxx@xxx.xxx # Mail failed updates to user pid=/var/run/ddclient.pid # record PID in file. ssl=yes # enables ssl

  1. Detect IP with our CheckIP? server

use=web, web=checkip.dyndns.com/, web-skip='IP Address'

  1. DynDNS username and password here

login=xxx password=xxx

  1. Default options

protocol=dyndns2 server=members.dyndns.org

  1. Dynamic DNS hosts

xxx.dynalias.com

save all changes, then edit rc.xinetd your autostart script:

  1. nano /unslung/rc.xinetd

and add lines:

  1. DynDNS Client

if [ -n "`pidof ddclient`" ]; then

   kill -9 `pidof ddclient`

fi

ddclient

Save all changes and it's done, you have ddclient up and running next time you restart your box or if you just load rc.xinetd once again! Do not forget to make it executable:

  1. chmod 755 /unslung/rc.xinetd

Krzysztof Sokol

July 06, 2008, at 05:38 PM by SRS -- format
Added line 1112:
Added line 1114:
Added line 1116:
Added line 1119:
July 06, 2008, at 05:36 PM by SRS -- format fix
Changed lines 1111-1115 from:

For a variation that will send your dynamic ip address as a html web page to a web server at a static address (of your choice) see the page at SetUpYourOwnStaticLinkToYourSiteAtADynamicIP ( http://www.nslu2-linux.org/wiki/HowTo/SetUpYourOwnStaticLinkToYourSiteAtADynamicIP )

to:

For a variation that will send your dynamic ip address as a html web page to a web server at a static address (of your choice) see the page at SetUpYourOwnStaticLinkToYourSiteAtADynamicIP ( http://www.nslu2-linux.org/wiki/HowTo/SetUpYourOwnStaticLinkToYourSiteAtADynamicIP )

July 06, 2008, at 05:34 PM by SRS -- format fix
July 06, 2008, at 05:32 PM by SRS -- A variation using static ftp site
Added lines 1107-1113:

07/06/2008

For a variation that will send your dynamic ip address as a html web page to a web server at a static address (of your choice) see the page at SetUpYourOwnStaticLinkToYourSiteAtADynamicIP ( http://www.nslu2-linux.org/wiki/HowTo/SetUpYourOwnStaticLinkToYourSiteAtADynamicIP ) SRS 07/06/2008

December 27, 2007, at 12:10 PM by Me --
Changed lines 27-28 from:

Would you please post instuctionson how to get ddclient working, including// how to make it automaticaly start when I power up the slug. The above info//

to:

Would you please post instuctionson how to get ddclient working, including
how to make it automaticaly start when I power up the slug. The above info\\

December 27, 2007, at 12:09 PM by Me --
Changed lines 27-29 from:

Would you please post instuctionson how to get ddclient working, including how to make it automaticaly start when I power up the slug. The above info has not worked yet. I'm shure there is something missing. thanks

to:

Would you please post instuctionson how to get ddclient working, including// how to make it automaticaly start when I power up the slug. The above info// has not worked yet. I'm shure there is something missing. thanks

December 27, 2007, at 12:08 PM by Me --
Added lines 27-28:

Would you please post instuctionson how to get ddclient working, including how to make it automaticaly start when I power up the slug. The above info has not worked yet. I'm shure there is something missing. thanks


December 26, 2007, at 02:32 AM by Roga --
Added line 24:
December 26, 2007, at 02:31 AM by Roga --
Changed line 23 from:
to:

more ddclient usage info: http://ddclient.wiki.sourceforge.net/

December 26, 2007, at 02:29 AM by Roga --
Changed lines 5-6 from:

ddcliend worked after creating ddclient.conf

to:

ddclient worked after creating ddclient.conf

December 26, 2007, at 02:28 AM by Roga --
December 26, 2007, at 02:28 AM by Roga --
Changed lines 1-2 from:

ddclient, updatedd, inadyn are in optware feed. Please test.

to:

ddclient, updatedd, inadyn are in optware feed. Please test.

Changed lines 5-6 from:
  • ddcliend worked after creating ddclient.conf
to:

ddcliend worked after creating ddclient.conf

December 26, 2007, at 02:27 AM by Roga --
Changed lines 5-6 from:
  • ddcliend worked after creating ddclient.conf
to:
  • ddcliend worked after creating ddclient.conf

vi /opt/etc/ddclient/ddclient.conf

Paste there your data:

Changed lines 13-19 from:
 vi /opt/etc/ddclient/ddclient.conf
to:
 # /opt/etc/ddclient/ddclient.conf
 #
 protocol=dyndns2
 use=web
 login=mylogin
 password=mypassword
 myhost.dyndns.org
Changed lines 23-37 from:

Paste there your data:

(:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
# /etc/ddclient/ddclient.conf
#
 protocol=dyndns2
 use=web
 login=mylogin
 password=mypassword
 myhost.dyndns.org

(:tableend:)

to:
December 26, 2007, at 02:25 AM by Roga --
Changed lines 5-6 from:
  • ddcliend worked after creating ddclient.conf
to:
  • ddcliend worked after creating ddclient.conf
Added line 12:
Added line 14:
Changed lines 19-23 from:

protocol=dyndns2 use=web login=mylogin password=mypassword myhost.dyndns.org

to:
 protocol=dyndns2
 use=web
 login=mylogin
 password=mypassword
 myhost.dyndns.org
Added lines 27-28:

Roga, dec07

December 26, 2007, at 02:23 AM by Roga --
Changed lines 5-17 from:

I have added a workaround to update the dyndns.org service, as my DSL-Router has no option to do this.

Install wget: ipkg install wget nb if you have already upgraded BusyBox then the above might fail- see HowTo.InstallWgetAfterUpgradingBusyBox


if /var/tmp does not exist create it: mkdir /var/tmp
Add dnsupd script: vi /opt/bin/dnsupd

to:
  • ddcliend worked after creating ddclient.conf
Changed lines 8-18 from:
 #!/bin/ash
 wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
 then echo "No new IP";
 else wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip
 echo "New IP";
 cat /var/tmp/upd.ip;
 rm /var/tmp/upd.ip;
 fi
 rm -f /var/tmp/old.ip
 mv /var/tmp/new.ip /var/tmp/old.ip
to:
 vi /opt/etc/ddclient/ddclient.conf
Added lines 11-25:

Paste there your data: (:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
# /etc/ddclient/ddclient.conf
#
protocol=dyndns2
use=web
login=mylogin
password=mypassword
myhost.dyndns.org

(:tableend:)


I have added a workaround to update the dyndns.org service, as my DSL-Router has no option to do this.\\

Changed lines 27-30 from:

replace the following with your datas:
username = your DynDNS.org username
password = your DynDNS.org password
domainname = your registered domainname (i.e. whatever.dyndns.org)

to:

Install wget: ipkg install wget nb if you have already upgraded BusyBox then the above might fail- see HowTo.InstallWgetAfterUpgradingBusyBox

Changed lines 32-33 from:

make dnsupd executable: chmod 755 /opt/bin/dnsupd

to:

if /var/tmp does not exist create it: mkdir /var/tmp

Changed lines 35-40 from:


The script should start once after reboot:
create S60dnsupd (or use an other number if S60xxx exists...):
vi /opt/etc/init.d/S60dnsupd

to:

Add dnsupd script: vi /opt/bin/dnsupd

Changed lines 39-43 from:

(:cell:)

 [=
 #!/bin/sh
 if [ -n "`pidof dnsupd`" ]; then
    /bin/killall dnsupd 2>/dev/null
to:

(:cell:)[@

 #!/bin/ash
 wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
 then echo "No new IP";
 else wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip
 echo "New IP";
 cat /var/tmp/upd.ip;
 rm /var/tmp/upd.ip;
Changed lines 49-51 from:
 umask 077
 /opt/bin/dnsupd

=]

to:
 rm -f /var/tmp/old.ip
 mv /var/tmp/new.ip /var/tmp/old.ip

@]

Changed lines 54-55 from:

make S60dnsupd executable:
chmod 755 /opt/etc/init.d/S60dnsupd\\

to:

replace the following with your datas:
username = your DynDNS.org username
password = your DynDNS.org password
domainname = your registered domainname (i.e. whatever.dyndns.org)

Changed lines 59-60 from:

Now the script should run every 15 min
vi /etc/crontab\\

to:

make dnsupd executable: chmod 755 /opt/bin/dnsupd

Deleted lines 61-62:

add the following line:
*/15 * * * * root /opt/bin/dnsupd &>/dev/null\\

Changed lines 63-65 from:

I offer no warranty of this information!\\

to:

The script should start once after reboot:
create S60dnsupd (or use an other number if S60xxx exists...):
vi /opt/etc/init.d/S60dnsupd

Changed lines 67-86 from:

For your information i use the build UNSLUNG-1.11-beta-V23R25.bin
Please, feel free to edit every error or add new information about optimizing or any else...
P.S.: sorry for my bad english.. i'am still learning...

Otte


If you are using DynDNS for a custom domain (like mydomain.com), then you'll have to use a different wget string to update the IP address. It is as follows:

http://USERNAME:PASSWORD@members.dyndns.org/nic/update?system=custom&hostname=DOMAINNAME.COM

Just change USERNAME, PASSWORD, and DOMAINNAME.COM for it to work.

Mookie


My dyndns provider OVH (ovh.com) is not providing an auto check of the ip address, it means that I need the ip address to be given in the wget string to update the IP address. The provider is also not providing a page to "see" my ip, so I modified the /opt/bin/dnsupd script the following way:

to:
Changed lines 71-81 from:
 #!/bin/ash
 #Get the current ip and put it into /var/tmp/tmp.ip
 wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/tmp.ip
 #Parse the answer to get only the ip and put it into /var/tmp/new.ip
 sed -e 's/^.*Address: //' -e 's/<.*$//' /var/tmp/tmp.ip > /var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
 then echo "No new IP";
 else wget -q http://LOGIN:PASSWORD@www.ovh.com/nic/update?myip=`cat /var/tmp/new.ip`\&hostname=DOMAIN\&system=dyndns --output-document=/var/tmp/upd.ip
 echo "New IP";
 cat /var/tmp/upd.ip;
 rm /var/tmp/upd.ip;
to:
 #!/bin/sh
 if [ -n "`pidof dnsupd`" ]; then
    /bin/killall dnsupd 2>/dev/null
Changed lines 75-77 from:
 rm -f /var/tmp/old.ip
 rm /var/tmp/tmp.ip
 mv /var/tmp/new.ip /var/tmp/old.ip
to:
 umask 077
 /opt/bin/dnsupd
Deleted lines 78-96:

Note the backslash (\) before & in the wget string.

For info: http://www.dyndns.org/developers/specs/syntax.html

--titoo

If you use DynDNS wildcards, you should include \&wildcard=NOCHG in the update line.

This script still doesn't meet the requirements. One must send an update after 28 days even if the ip address hasn't changed. DynDNS will disable your account for abuse if you update too often, and for inactivity if you're lucky enough to have a stable IP address for 30 days. They allow a refresh at 28 days.

I don't have a solution for this within the constraints of a script and the standard shell.

Hint: with bash, one could set an expiration with touch -d 28days /var/tmp/exp.ip, and use && ! /var/tmp/new.ip -nt /var/tmp/exp.ip in the update decision...

There are a number of perl & similar scripts at DynDNS.org that seem to do the right things.

--tlhackque


Changed lines 80-81 from:

Find a complete solution below, to run only every 28 days: - tested on unslung V2.3R25-uNSLUng-standard-3.18-beta - 2005-04-01 -

to:

make S60dnsupd executable:
chmod 755 /opt/etc/init.d/S60dnsupd\\

Changed lines 83-104 from:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
#!/bin/ash
 if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days` /var/tmp/exp.ip; fi
 if [ "`ls -l --time-style=+%Y-%m-%d /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'%m-%d'`" ]
 then wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]; then echo "No new IP";
 else wget -q http://''username'':''password''@members.dyndns.org/nic/update?hostname=''yourname.dyndns.org'' --output-document=/var/tmp/upd.ip\\
 echo "New IP";
 cat /var/tmp/upd.ip; 
 rm /var/tmp/upd.ip; 
 fi 
 rm -f /var/tmp/old.ip
 mv /var/tmp/new.ip /var/tmp/old.ip
 touch /var/tmp/exp.ip 
 else echo "Skipped"
 fi

(:tableend:)

to:

Now the script should run every 15 min
vi /etc/crontab\\

Changed lines 86-87 from:

NOTE: for less use of CPU, modify the /etc/crontab entry,to run just once per day :-) 5 17 * * * root /opt/bin/dnsupd &> /dev/null\\

to:

add the following line:
*/15 * * * * root /opt/bin/dnsupd &>/dev/null\\

Changed lines 89-96 from:

--matrix69

to:

I offer no warranty of this information!

For your information i use the build UNSLUNG-1.11-beta-V23R25.bin
Please, feel free to edit every error or add new information about optimizing or any else...
P.S.: sorry for my bad english.. i'am still learning...

Otte

Changed lines 98-112 from:

If your NSLU2 is behind a transparent proxy, http://checkip.dyndns.com and http://members.dyndns.org may return/update with your proxy server's IP address instead of your NSLU2's.

DynDns recommend the use of port 8245 so I have updated my scripts to use

http://checkip.dyndns.com:8245/index.html

http//<login>:<password>@members.dyndns.org:8245/nic/update?hostname=<yourDynHostName>

and I always get the right IP.

Ming Kiat 14 Apr 2005

to:

If you are using DynDNS for a custom domain (like mydomain.com), then you'll have to use a different wget string to update the IP address. It is as follows:

http://USERNAME:PASSWORD@members.dyndns.org/nic/update?system=custom&hostname=DOMAINNAME.COM

Just change USERNAME, PASSWORD, and DOMAINNAME.COM for it to work.

Mookie

Changed lines 109-121 from:

The copied-pasted 28-day complete solution script above didn't work for me on Unslung 4 beta, perhaps because of plain old vanilla non-upgraded ls built-into BusyBox v0.60.4. It gave error "EOF: back quote parsing error" and complained about --time-style option being invalid option for ls. I changed the output of date command to match output of ls. Also, matrix69's script will update IP only once every 28 days, as opposed to

 1) Checking IP (once an hour or so) and updating IP if it changes

and

 2) Updating IP every 28 days even if IP has not changed yet


Here is modified script that does the above and works with limited ls from BusyBox that comes with Unslung 4 beta binary.
Of course, the script needs to be scheduled to run on regular intervals in crontab to fulfill its purposes. DynDNS website does not allow/recommend checking IP with them more often than every 10 minutes.

to:

My dyndns provider OVH (ovh.com) is not providing an auto check of the ip address, it means that I need the ip address to be given in the wget string to update the IP address. The provider is also not providing a page to "see" my ip, so I modified the /opt/bin/dnsupd script the following way:

Changed lines 115-116 from:
 if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days /var/tmp/exp.ip;
to:
 #Get the current ip and put it into /var/tmp/tmp.ip
 wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/tmp.ip
 #Parse the answer to get only the ip and put it into /var/tmp/new.ip
 sed -e 's/^.*Address: //' -e 's/<.*$//' /var/tmp/tmp.ip > /var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
 then echo "No new IP";
 else wget -q http://LOGIN:PASSWORD@www.ovh.com/nic/update?myip=`cat /var/tmp/new.ip`\&hostname=DOMAIN\&system=dyndns --output-document=/var/tmp/upd.ip
 echo "New IP";
 cat /var/tmp/upd.ip;
 rm /var/tmp/upd.ip;
Changed lines 126-149 from:
 if [ "`ls -l /var/tmp/exp.ip |cut -b44-49`" = "`date --date="-28 days" +'e'`" ]
 then
   wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com\&wildcard=NOCHG --output-document=/var/tmp/upd.ip
   echo "28-th day - Mandatory update. Refreshed IP:";
   cat /var/tmp/upd.ip; 
   rm /var/tmp/upd.ip;  
   rm -f /var/tmp/old.ip
   mv /var/tmp/new.ip /var/tmp/old.ip
   touch /var/tmp/exp.ip 
 else
  echo "Checking IP ..."
  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 "No new IP";
   else wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com\&wildcard=NOCHG --output-document=/var/tmp/upd.ip
  echo "New IP:";
     cat /var/tmp/upd.ip; 
     rm /var/tmp/upd.ip; 
   fi 
   rm -f /var/tmp/old.ip
   mv /var/tmp/new.ip /var/tmp/old.ip
   touch /var/tmp/exp.ip 
 fi
to:
 rm -f /var/tmp/old.ip
 rm /var/tmp/tmp.ip
 mv /var/tmp/new.ip /var/tmp/old.ip
Changed lines 131-149 from:
to:

Note the backslash (\) before & in the wget string.

For info: http://www.dyndns.org/developers/specs/syntax.html

--titoo

If you use DynDNS wildcards, you should include \&wildcard=NOCHG in the update line.

This script still doesn't meet the requirements. One must send an update after 28 days even if the ip address hasn't changed. DynDNS will disable your account for abuse if you update too often, and for inactivity if you're lucky enough to have a stable IP address for 30 days. They allow a refresh at 28 days.

I don't have a solution for this within the constraints of a script and the standard shell.

Hint: with bash, one could set an expiration with touch -d 28days /var/tmp/exp.ip, and use && ! /var/tmp/new.ip -nt /var/tmp/exp.ip in the update decision...

There are a number of perl & similar scripts at DynDNS.org that seem to do the right things.

--tlhackque


Changed lines 151-152 from:

It is important to note that this script will work ONLY if NSLU2 is up and running on the 28-th day so it can detect the condition when current date is equal to current date minus 28 days.

to:

Find a complete solution below, to run only every 28 days: - tested on unslung V2.3R25-uNSLUng-standard-3.18-beta - 2005-04-01 -

Changed lines 154-161 from:


Andrei Volkov

June 13, 2005


Now, why couldn't the 28-day refreshment be made simply by a second "forced" crontab entry, like:

to:
Changed lines 157-173 from:

59 23 14,28 * * root /opt/bin/dnsupd-force &> /dev/null

to:
 
#!/bin/ash
 if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days` /var/tmp/exp.ip; fi
 if [ "`ls -l --time-style=+%Y-%m-%d /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'%m-%d'`" ]
 then wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]; then echo "No new IP";
 else wget -q http://''username'':''password''@members.dyndns.org/nic/update?hostname=''yourname.dyndns.org'' --output-document=/var/tmp/upd.ip\\
 echo "New IP";
 cat /var/tmp/upd.ip; 
 rm /var/tmp/upd.ip; 
 fi 
 rm -f /var/tmp/old.ip
 mv /var/tmp/new.ip /var/tmp/old.ip
 touch /var/tmp/exp.ip 
 else echo "Skipped"
 fi

Changed lines 176-182 from:

Sure, that would run on 14th and 28th, is that too often?

Also, what's the purpose of "*/15" in the beginning of original crontab line, why not just "15".

Asko Kauppi Nov 24th 2005

to:


NOTE: for less use of CPU, modify the /etc/crontab entry,to run just once per day :-) 5 17 * * * root /opt/bin/dnsupd &> /dev/null

--matrix69

Changed lines 182-187 from:

The above scripts could trigger an update if, for any reason, the initial wget of checkip.dyndns.org failed. So it probably doesn't do any harm to surround the update with a check to ensure that the files containing the old.ip and new.ip look as though they contain valid data. My update script looks like this:

to:

If your NSLU2 is behind a transparent proxy, http://checkip.dyndns.com and http://members.dyndns.org may return/update with your proxy server's IP address instead of your NSLU2's.

DynDns recommend the use of port 8245 so I have updated my scripts to use

http://checkip.dyndns.com:8245/index.html

http//<login>:<password>@members.dyndns.org:8245/nic/update?hostname=<yourDynHostName>

and I always get the right IP.

Ming Kiat 14 Apr 2005


The copied-pasted 28-day complete solution script above didn't work for me on Unslung 4 beta, perhaps because of plain old vanilla non-upgraded ls built-into BusyBox v0.60.4. It gave error "EOF: back quote parsing error" and complained about --time-style option being invalid option for ls. I changed the output of date command to match output of ls. Also, matrix69's script will update IP only once every 28 days, as opposed to

 1) Checking IP (once an hour or so) and updating IP if it changes

and

 2) Updating IP every 28 days even if IP has not changed yet


Here is modified script that does the above and works with limited ls from BusyBox that comes with Unslung 4 beta binary.
Of course, the script needs to be scheduled to run on regular intervals in crontab to fulfill its purposes. DynDNS website does not allow/recommend checking IP with them more often than every 10 minutes.

Changed lines 215-217 from:
 #!/bin/sh
 wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
to:
 #!/bin/ash

 if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days /var/tmp/exp.ip;
 fi

 if [ "`ls -l /var/tmp/exp.ip |cut -b44-49`" = "`date --date="-28 days" +'e'`" ]
Changed lines 222-228 from:
        echo "No new IP"
to:
   wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com\&wildcard=NOCHG --output-document=/var/tmp/upd.ip
   echo "28-th day - Mandatory update. Refreshed IP:";
   cat /var/tmp/upd.ip; 
   rm /var/tmp/upd.ip;  
   rm -f /var/tmp/old.ip
   mv /var/tmp/new.ip /var/tmp/old.ip
   touch /var/tmp/exp.ip 
Changed lines 230-236 from:
        PAT='Current IP Address:.*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'
        if grep -q "$PAT" /var/tmp/new.ip && grep -q "$PAT" /var/tmp/old.ip; then
                wget -q 'http://MYNAME:MYPASSWORD@members.dyndns.org/nic/update?system=custom&hostname=MYHOST.MYDOMAIN.co.uk' -O /var/tmp/upd.ip
                echo "New IP"
                mv /var/tmp/new.ip /var/tmp/old.ip
                rm -f /var/tmp/upd.ip
        fi
to:
  echo "Checking IP ..."
  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 "No new IP";
   else wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com\&wildcard=NOCHG --output-document=/var/tmp/upd.ip
  echo "New IP:";
     cat /var/tmp/upd.ip; 
     rm /var/tmp/upd.ip; 
   fi 
   rm -f /var/tmp/old.ip
   mv /var/tmp/new.ip /var/tmp/old.ip
   touch /var/tmp/exp.ip 
Changed lines 246-251 from:

The two greps ensure that the files contain the expected pattern before trusting their content.

John Bates - 4th Feb 2006

to:


It is important to note that this script will work ONLY if NSLU2 is up and running on the 28-th day so it can detect the condition when current date is equal to current date minus 28 days.

Andrei Volkov

June 13, 2005

Changed lines 255-259 from:

This is my litle dirty solution. A read-only-method. (tested on openslug 2.7)

to:

Now, why couldn't the 28-day refreshment be made simply by a second "forced" crontab entry, like:

Added lines 259-277:

59 23 14,28 * * root /opt/bin/dnsupd-force &> /dev/null (:tableend:)

Sure, that would run on 14th and 28th, is that too often?

Also, what's the purpose of "*/15" in the beginning of original crontab line, why not just "15".

Asko Kauppi Nov 24th 2005


The above scripts could trigger an update if, for any reason, the initial wget of checkip.dyndns.org failed. So it probably doesn't do any harm to surround the update with a check to ensure that the files containing the old.ip and new.ip look as though they contain valid data. My update script looks like this:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

Added lines 279-310:
 #!/bin/sh
 wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
 then
        echo "No new IP"
 else
        PAT='Current IP Address:.*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'
        if grep -q "$PAT" /var/tmp/new.ip && grep -q "$PAT" /var/tmp/old.ip; then
                wget -q 'http://MYNAME:MYPASSWORD@members.dyndns.org/nic/update?system=custom&hostname=MYHOST.MYDOMAIN.co.uk' -O /var/tmp/upd.ip
                echo "New IP"
                mv /var/tmp/new.ip /var/tmp/old.ip
                rm -f /var/tmp/upd.ip
        fi
 fi

=] (:tableend:)

The two greps ensure that the files contain the expected pattern before trusting their content.

John Bates - 4th Feb 2006


This is my litle dirty solution. A read-only-method. (tested on openslug 2.7)

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 [=
December 26, 2007, at 01:58 AM by roga --
Changed line 3 from:
  • ddclient works perfectly with dyndns.com - ipkg install ddclient ( i did mess first with the scripts below but no success) - BR oct07
to:
  • ddclient works perfectly with dyndns.com - ipkg install ddclient ( i did mess first with the scripts below but no success) - BR oct07
October 14, 2007, at 03:02 AM by bren --
Changed line 3 from:
  • ddclient works perfectly with dyndns.com - ipkg install ddclient ( i did mess first with the scripts below but no success)
to:
  • ddclient works perfectly with dyndns.com - ipkg install ddclient ( i did mess first with the scripts below but no success) - BR oct07
October 14, 2007, at 03:01 AM by bren --
Added line 3:
  • ddclient works perfectly with dyndns.com - ipkg install ddclient ( i did mess first with the scripts below but no success)
September 02, 2007, at 10:03 PM by BrianZhou -- refer to ddclient, updatedd and inadyn
Added lines 1-3:

ddclient, updatedd, inadyn are in optware feed. Please test.


May 25, 2007, at 07:56 AM by DavidH -- typo
Changed lines 713-714 from:
to:

DavidH

May 25, 2007, at 07:54 AM by DavidH --
Changed lines 711-714 from:

RobHam?, if I modify the paths as you propose this prevents the harddisk from spinning down, which is the main reason for using a ramdisk. Shouldn't it be the other way round?

DavidH?

to:

RobHam, if I modify the paths as you propose this prevents the harddisk from spinning down, which is the main reason for using a ramdisk. Shouldn't it be the other way round?

[DavidH?]

May 25, 2007, at 07:53 AM by DavidH -- paths when using a ramdisk (spin down issue)
Added lines 711-716:

RobHam?, if I modify the paths as you propose this prevents the harddisk from spinning down, which is the main reason for using a ramdisk. Shouldn't it be the other way round?

DavidH?


April 27, 2007, at 02:42 PM by RobHam -- Follow up regarding 0.9.4 changes
Changed lines 1058-1059 from:

can be re-written as follows.

to:

can be re-written using variables as follows.

Changed lines 1066-1068 from:

Have not committed this to the script, to allow other to test first.

RobHam?

to:

Have not committed this to the script, to allow others to test first.

RobHam

April 27, 2007, at 02:39 PM by RobHam -- Follow up regarding 0.9.4 changes
Added lines 1045-1068:

Follow up - I can replicate this. I tried all combinations
of available 'find' (two versions) and 'rm' (three versions)
with my Unslung NSLU2. The script with variables seems to
work OK when using the default 'find' version 4.1.20 or
Optware 'find' version 4.2.30 together with either the
default 'rm' from Busybox version 0.60.4 or 'rm' from the
Optware Coreutils version 6.7. For reasons not fully
understood there seems to be a problem using variables
when using 'rm' from the later Optware Busybox version 1.5.0.

There is a work around. The later Optware version of
'find' 4.2.30 allows you to use -delete rather than
-exec rm {} \; so with this version the script line
can be re-written as follows.

(:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
${FIND} ${VAR}/tmp/ -name old.ip -mtime +27 -delete

(:tableend:)

Have not committed this to the script, to allow other to test first.

RobHam?

April 26, 2007, at 03:48 PM by Phil Endecott -- No change, to hopefully flush spam from the \'recent changes\' page
Changed lines 1045-1046 from:

to:

April 25, 2007, at 09:31 PM by Mo --
Changed line 767 from:

VER=NSLU2-Linux-DNSUPD-0.9.3beta

to:

VER=NSLU2-Linux-DNSUPD-0.9.4beta

Changed lines 873-875 from:
      ${FIND} ${VAR}/tmp/ -name old.ip -mtime +27 -exec ${RM} {} \;
to:
      # you must enter the appropriate paths for the find command
      # but do not use variables in the string or it may not work correctly 
      /opt/bin/find /opt/var/tmp/ -name old.ip -mtime +27 -exec rm {} \;
Added lines 1020-1044:

I am not exactly sure why, but testing proves that the find command does
not seem to function with variables in the string. Thus previous script versions
will fail to do a refresh. refresh seems only to work in the script if it is as it
would be typed from the command line.
My suggested change for the script is as follows:
(:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
# you must enter the appropriate paths for the find command
# but do not use variables in the string or it may not work correctly 
/opt/bin/find /opt/var/tmp/ -name old.ip -mtime +27 -exec rm {} \;

(:tableend:)
Script bumped to Version 0.9.4

Wonderful work guys!

Mo

April 19, 2007, at 09:17 PM by RobHam -- Comments added from Dyndns Certification Technician, script updated to 0.9.3beta
Deleted line 991:
Deleted line 995:
Changed lines 1014-1015 from:
to:

Certification Technician
Dynamic Network Services, Inc.

April 19, 2007, at 09:09 PM by RobHam -- Comments added from Dyndns Certification Technician, script updated to 0.9.3beta
Changed lines 985-988 from:

His suggestions are included in the above script and
bumped the script to version 0.9.3beta.

to:

His suggestions regarding the error return string
are included in the above script, script bumped up
to version 0.9.3beta.

Changed lines 995-997 from:

if ${GREP} "\!yours\|notfqdn\|abuse\|nohost\|nochg\|badagent\|badauth\|badsys" ${VAR}/tmp/upd.ip >/dev/null

to:

if ${GREP} "\!yours\|notfqdn\|abuse\|nohost\|nochg\|badagent\|badauth\|badsys"

Changed lines 1015-1017 from:
to:
April 19, 2007, at 09:04 PM by RobHam -- Comments added from Dyndns Certification Technician, script updated to 0.9.3beta
Changed line 985 from:

I have included his suggestions in the above script and\\

to:

His suggestions are included in the above script and\\

Changed line 988 from:
to:
Deleted line 1002:
Deleted line 1008:
Changed lines 1016-1018 from:
to:
April 19, 2007, at 09:01 PM by RobHam -- Comments added from Dyndns Certification Technician, script updated to 0.9.3beta
Changed lines 983-984 from:

The following paragraph are comments received from a Certification\\ Technician from Dynamic Network Services, Inc. I have included his\\ suggestions in the above script and bumped the script to version 0.9.3beta.

to:

The following paragraph are comments received from a
Certification Technician from Dynamic Network Services.
I have included his suggestions in the above script and
bumped the script to version 0.9.3beta.

Changed lines 990-993 from:

In the return code parsing section, you have:

  1. Analyse and report any Fatal error return strings
    [=if ${GREP}
to:

In the return code parsing section, you have:

 [=
  1. Analyse and report any Fatal error return strings

if ${GREP}

Changed lines 996-997 from:

${VAR}/tmp/upd.ip >/dev/null=]

to:

${VAR}/tmp/upd.ip >/dev/null =]

Added line 1004:
 [=
Changed lines 1009-1010 from:
to:

=]

Changed lines 1019-1022 from:

Thank you,

Matt

to:
April 19, 2007, at 08:56 PM by RobHam -- Comments added from Dyndns Certification Technician, script updated to 0.9.3beta
Changed line 924 from:
  if ${GREP} "\!yours\|notfqdn\|abuse\|nohost\|badagent\|badauth\|badsys\|!donator\|dnserr\|numhost\|911" ${VAR}/tmp/upd.ip >/dev/null
to:
  if ${GREP} "\!yours\|notfqdn\|abuse\|nohost\|badagent\|badauth\|badsys\|dnserr\|numhost\|911\|\!donator" ${VAR}/tmp/upd.ip >/dev/null
Changed lines 983-988 from:

The following paragraph are comments received from a Certification Technician from Dynamic Network Services, Inc. I have included his suggestions and bumped the script to version 0.9.3beta.

  [= I've tested out the script, and I have a few suggestions. In the return code parsing section, you 

have:

  1. Analyse and report any Fatal error return strings if ${GREP}
to:

The following paragraph are comments received from a Certification\\ Technician from Dynamic Network Services, Inc. I have included his\\ suggestions in the above script and bumped the script to version 0.9.3beta.

I've tested out the script, and I have a few suggestions.
In the return code parsing section, you have:

  1. Analyse and report any Fatal error return strings
    [=if ${GREP}
Changed lines 991-996 from:

${VAR}/tmp/upd.ip >/dev/null

You can remove nochg from this list, as if this is the first time the client updates and your IP is the same, it will receive a nochg error which is fine. There are, however, four other error codes you should add in:

to:

${VAR}/tmp/upd.ip >/dev/null=]

You can remove nochg from this list, as if this is the first time
the client updates and your IP is the same, it will receive
a nochg error which is fine. There are, however, four other error
codes you should add in:

Changed lines 1003-1008 from:

Also, does NSLU2 include sendmail or something similar? If so, I think it would be a good idea to have the script send an E-mail notification on a failed update, though it's not a requirement of ours.

Aside from that, I believe that script is fine, and we certainly appreciate it when developers follow our specifications.

to:

Also, does NSLU2 include sendmail or something similar?
If so, I think it would be a good idea to have the script
send an E-mail notification on a failed update, though it's
not a requirement of ours.

Aside from that, I believe that script is fine, and we certainly
appreciate it when developers follow our specifications.

Changed lines 1013-1014 from:

Matt =]

to:

Matt

April 19, 2007, at 08:35 PM by RobHam -- Comments added from Dyndns Certification Technician, script updated to 0.9.3beta
Changed line 767 from:

VER=NSLU2-Linux-DNSUPD-0.9.2beta

to:

VER=NSLU2-Linux-DNSUPD-0.9.3beta

Changed line 924 from:
  if ${GREP} "\!yours\|notfqdn\|abuse\|nohost\|nochg\|badagent\|badauth\|badsys" ${VAR}/tmp/upd.ip >/dev/null
to:
  if ${GREP} "\!yours\|notfqdn\|abuse\|nohost\|badagent\|badauth\|badsys\|!donator\|dnserr\|numhost\|911" ${VAR}/tmp/upd.ip >/dev/null
Changed lines 981-1012 from:

Matt Horsfall

to:

Matt Horsfall


The following paragraph are comments received from a Certification Technician from Dynamic Network Services, Inc. I have included his suggestions and bumped the script to version 0.9.3beta.

   I've tested out the script, and I have a few suggestions. In the return code parsing section, you 
have: 

# Analyse and report any Fatal error return strings if ${GREP} 
"\!yours\|notfqdn\|abuse\|nohost\|nochg\|badagent\|badauth\|badsys"
${VAR}/tmp/upd.ip >/dev/null 

You can remove nochg from this list, as if this is the first time the client updates and your IP is the 
same, it will receive a nochg error which is fine. There are, however, four other error codes you 
should add in: 

!donator
dnserr
911
numhost

Also, does NSLU2 include sendmail or something similar? If so, I think it would be a good idea to 
have the script send an E-mail notification on a failed update, though it's not a requirement of ours. 

Aside from that, I believe that script is fine, and we certainly appreciate it when developers follow 
our specifications. 

Thank you,

Matt  

RobHam


April 09, 2007, at 10:37 PM by mhorsfall --
Changed line 767 from:

VER=NSLU2-Linux-DNSUPD-0.9.1beta

to:

VER=NSLU2-Linux-DNSUPD-0.9.2beta

Added line 980:
April 09, 2007, at 10:36 PM by mhorsfall --
Changed lines 976-980 from:

RobertSlater

to:

RobertSlater


Changed MYIP="${SED} -e 's|.*Address: ||; s|</body>.*||' ${VAR}/tmp/now.ip" to MYIP="`${SED} -e 's|.*Address: ||; s|</body>.*||' ${VAR}/tmp/now.ip`" so it actually gets executed. Matt Horsfall

April 09, 2007, at 10:34 PM by mhorsfall -- Make sure that sed command gets executed.
Changed line 844 from:
  MYIP="${SED} -e 's|.*Address: ||; s|</body>.*||' ${VAR}/tmp/now.ip"
to:
  MYIP="`${SED} -e 's|.*Address: ||; s|</body>.*||' ${VAR}/tmp/now.ip`"
March 27, 2007, at 10:13 PM by RobHam -- Ref - mkdir recommendation - have added the -p flag to the script
Changed line 816 from:

${MKDIR} ${VAR}/log

to:

${MKDIR} -p ${VAR}/log

Changed line 820 from:

${MKDIR} ${VAR}/tmp

to:

${MKDIR} -p ${VAR}/tmp

March 22, 2007, at 02:16 PM by robert slater --
Changed lines 960-962 from:

A "can't make directory error". I addded the "-p" option to mkdir. \\This is on a very new unmodified box.

to:

A "can't make directory error". I addded the "-p" option to mkdir.
This is on a very new unmodified box.

Changed lines 975-976 from:

(:tableend:)

to:

(:tableend:) RobertSlater

March 22, 2007, at 02:14 PM by robert slater --
Changed lines 958-960 from:

If this script has not run before, and the directories /var/tmp and /var/log do not exist, <BR>then the script can not create them. A "can't make directory error". I addded the "-p" option to mkdir. This is on a very new unmodified box.

to:

If this script has not run before, and the directories /var/tmp and /var/log do not exist,
then the script can not create them.
A "can't make directory error". I addded the "-p" option to mkdir. \\This is on a very new unmodified box.

Changed line 963 from:

# Check and create folders

to:
  1. Check and create folders
March 22, 2007, at 02:13 PM by robert slater --
Changed lines 959-960 from:
to:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)[@

Changed lines 962-969 from:

if [ ! -d ${VAR}/log ]; then ${MKDIR} -p ${VAR}/log ${CHMOD} 755 ${VAR}/log fi if [ ! -d ${VAR}/tmp ]; then ${MKDIR} -p ${VAR}/tmp ${CHMOD} 755 ${VAR}/tmp fi

to:

if [ ! -d ${VAR}/log ]; then ${MKDIR} -p ${VAR}/log ${CHMOD} 755 ${VAR}/log fi@@ if [ ! -d ${VAR}/tmp ]; then ${MKDIR} -p ${VAR}/tmp ${CHMOD} 755 ${VAR}/tmp fi @] (:tableend:)

March 22, 2007, at 02:11 PM by robert slater --
Changed lines 958-970 from:

If this script has not run before, and the directories /var/tmp and /var/log do not exist, <BR>then the script can not create them. A "can't make directory error". I addded the "-p" option to mkdir.<BR> This is on a very new unmodified box. (:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)[@

  1. Check and create folders

if [ ! -d ${VAR}/log ]; then ${MKDIR} -p ${VAR}/log ${CHMOD} 755 ${VAR}/log fi if [ ! -d ${VAR}/tmp ]; then ${MKDIR} -p ${VAR}/tmp ${CHMOD} 755 ${VAR}/tmp fi (:tableend:)

to:

If this script has not run before, and the directories /var/tmp and /var/log do not exist, <BR>then the script can not create them. A "can't make directory error". I addded the "-p" option to mkdir. This is on a very new unmodified box.

# Check and create folders if [ ! -d ${VAR}/log ]; then ${MKDIR} -p ${VAR}/log ${CHMOD} 755 ${VAR}/log fi if [ ! -d ${VAR}/tmp ]; then ${MKDIR} -p ${VAR}/tmp ${CHMOD} 755 ${VAR}/tmp fi

March 22, 2007, at 02:08 PM by robert slater --
Changed lines 958-959 from:

If this script has not run before, and the directories /var/tmp and /var/log do not exist, then the script can not create them. A "can't make directory error". I addded the "-p" option to mkdir. This is on a very new unmodified box.

to:

If this script has not run before, and the directories /var/tmp and /var/log do not exist, <BR>then the script can not create them. A "can't make directory error". I addded the "-p" option to mkdir.<BR> This is on a very new unmodified box. (:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)[@

Changed line 970 from:
to:

(:tableend:)

March 22, 2007, at 02:06 PM by robert slater --
Added lines 958-969:

If this script has not run before, and the directories /var/tmp and /var/log do not exist, then the script can not create them. A "can't make directory error". I addded the "-p" option to mkdir. This is on a very new unmodified box.

  1. Check and create folders

if [ ! -d ${VAR}/log ]; then ${MKDIR} -p ${VAR}/log ${CHMOD} 755 ${VAR}/log fi if [ ! -d ${VAR}/tmp ]; then ${MKDIR} -p ${VAR}/tmp ${CHMOD} 755 ${VAR}/tmp fi

March 13, 2007, at 06:24 PM by RobHam -- Scripts with 28 day update, [=-mtime=] changed to [=+27=], this equates to 28 days
March 13, 2007, at 06:21 PM by RobHam -- Scripts with 28 day update, [=-mtime=] changed to =[+27=], this equates to 28 days
Changed line 347 from:
            /opt/bin/find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
to:
            /opt/bin/find /var/tmp/ -name old.ip -mtime +27 -exec rm {} \;
Changed line 413 from:
            /opt/bin/find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
to:
            /opt/bin/find /var/tmp/ -name old.ip -mtime +27 -exec rm {} \;
Changed line 477 from:
         find /var/log/ -name router_ip_old -mtime +28 -exec rm {} \;
to:
         find /var/log/ -name router_ip_old -mtime +27 -exec rm {} \;
Changed line 585 from:
      /opt/bin/find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
to:
      /opt/bin/find /var/tmp/ -name old.ip -mtime +27 -exec rm {} \;
Changed line 873 from:
      ${FIND} ${VAR}/tmp/ -name old.ip -mtime +28 -exec ${RM} {} \;
to:
      ${FIND} ${VAR}/tmp/ -name old.ip -mtime +27 -exec ${RM} {} \;
February 09, 2007, at 11:47 PM by RobHam -- Another enhanced version of the latest script added
Changed line 839 from:

${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/now.ip http://checkip.dyndns.com:8245/

to:

${WGET} -q -t 1 -T 30 -U ${VER} -O ${VAR}/tmp/now.ip http://checkip.dyndns.com:8245/

Changed line 859 from:
      ${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
to:
      ${WGET} -q -t 1 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
Changed line 888 from:
        ${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
to:
        ${WGET} -q -t 1 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
Changed line 897 from:
      ${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
to:
      ${WGET} -q -t 1 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
Changed line 916 from:
    ${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
to:
    ${WGET} -q -t 1 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
February 09, 2007, at 11:19 PM by RobHam -- Another improved - full feature script added
Changed line 801 from:

MKDIR=/bin/chmod

to:

MKDIR=/bin/mkdir

February 09, 2007, at 11:07 PM by RobHam -- Another improved - full feature script added
Changed line 784 from:

WILDCARD=OFF

to:

WILDCARD=ON

Changed lines 792-793 from:
  1. Update using either 'http' or 'https' (wget-ssl is needed for https)

HTTP=https

to:
  1. Update using either 'http' or 'https' (openssl and wget-ssl are needed for https)

HTTP=http

Changed lines 795-796 from:

SSL=--no-check-certificate

to:

SSL=

February 09, 2007, at 11:04 PM by RobHam -- Another improved - full feature script added
Changed line 751 from:

check the functionality on there system using one the DynDns\\

to:

check the functionality on there system using one of the DynDns\\

February 09, 2007, at 11:03 PM by RobHam -- Another improved - full feature script added
Changed lines 751-752 from:

check the functionality on there system using one the DynDns test\\ accounts before committing there own account details.

to:

check the functionality on there system using one the DynDns
test accounts before committing there own account details.

February 09, 2007, at 11:01 PM by RobHam -- Another improved - full feature script added
Changed lines 455-456 from:

Based on Mo and Neil's excellent script, adds logging of changes and just one daily log entry if no change:

to:

Based on Mo and Neil's excellent script, adds logging of changes and just
one daily log entry if no change:

Changed lines 522-523 from:

Thanks to my log file, I was able to see roughly how long my slug was out of contact with the web when the AC power blipped and made my hub lose its mind earlier this week during a thunderstorm. (even with my UPS, it's sensitive to power blips!) It will also allow me to get rough timings of network outages on the part of my ISP, as well as info about frequency of IP changes. I also chose to have it write one log entry per day indicating that the IP was static, on the first check after midnight. Change to a different argument for the date command, and you can use a different time interval for this entry.... :^)

to:

Thanks to my log file, I was able to see roughly how long my slug was out
of contact with the web when the AC power blipped and made my hub lose its
mind earlier this week during a thunderstorm. (even with my UPS, it's
sensitive to power blips!) It will also allow me to get rough timings of
network outages on the part of my ISP, as well as info about frequency of IP
changes. I also chose to have it write one log entry per day indicating that
the IP was static, on the first check after midnight. Change to a different
argument for the date command, and you can use a different time interval for\\ this entry.... :^)

Changed lines 660-663 from:

the actual log file: ip_hist.log into the directory /var/log/. I think all the .ip files
belong in /var/tmp/. I changed date +%w to date +%x, just in
case the slug experiences a T.K.O. for exactly 1 week, and I also made a couple
of other minor adjustments in logic flow.

to:

the actual log file: ip_hist.log into the directory /var/log/.
I think all the .ip files belong in /var/tmp/.
I changed date +%w to date +%x, just in case the slug
experiences a T.K.O. for exactly 1 week, and I also made a couple
of other minor adjustments in logic flow.\\

Changed lines 698-701 from:

Users who have configured there /var folder to be stored on a ram disk should modify the relevant parts of the scripts above so that the various files are saved to the alternative folders /opt/var/log and /opt/var/tmp. These two folders may need to be created by the user and flagged with chmod 755.

Note that for user written scripts such as these, the recommended folder tree to use with Unslung firmware is /opt/var.

to:

Users who have configured there /var folder to be stored on a ram
disk should modify the relevant parts of the scripts above so that the
various files are saved to the alternative folders /opt/var/log and
/opt/var/tmp. These two folders may need to be created by the user
and flagged with chmod 755.

Note that for user written scripts such as these, the recommended folder
tree to use with Unslung firmware is /opt/var.

Changed lines 725-728 from:

Update: Feb 2007
Another version of MO's excellent script above expanded so that the \\ script should comply with the DynDns Developers specification for an update client.

to:

Update: Feb 2007
Another version of MO's excellent script above expanded so
that the script should comply with the DynDns Developers
specification for an update client.

Changed lines 736-741 from:

3. Script will detect fatal errors returned from DynDns, detection \\ of a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it \\ backward compatible with early versions of the command programs that are used. \\ Note that the script is not fully tested with a full set of base firmware \\ command programs from all firmware versions. Users should consider upgrading \\ the command programs to the latest versions from the ipkg to guarantee the \\ correct functionality.

I have also used variables in place of program call paths to make it \\ easier for the script to be changed for different Linux distro’s.

to:

3. Script will detect fatal errors returned from DynDns, detection
of a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it
backward compatible with early versions of the command programs that
are used. Note that the script is not fully tested with a full set of
base firmware command programs from all firmware versions.
Users should consider upgrading the command programs to the latest
versions from the ipkg to guarantee the correct functionality.

I have also used variables in place of program call paths to make it
easier for the script to be changed for different Linux distro’s.

Changed lines 750-755 from:

Suggest that any potential users of this script version should first \\ check the functionality on there system using one the DynDns test \\ accounts before committing there own account details.

DynDns recommend the use of https so that user details and password \\ are encrypted, to use https users would need to install the Optware \\ packages openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump \\ the User-Agent script version to reflect these changes.

to:

Suggest that any potential users of this script version should first
check the functionality on there system using one the DynDns test\\ accounts before committing there own account details.

DynDns recommend the use of https so that user details and password
are encrypted, to use https users would need to install the Optware
packages openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump
the User-Agent script version to reflect these changes.

February 09, 2007, at 10:53 PM by RobHam -- Another improved - full feature script added
Changed lines 711-713 from:

Update: Feb 2007
Another version of MO's excellent script above expanded so that the\\ script should comply with the DynDns Developers specification for an update client.

to:

Update: Feb 2007
Another version of MO's excellent script above expanded so that the \\ script should comply with the DynDns Developers specification for an update client.

Changed lines 721-726 from:

3. Script will detect fatal errors returned from DynDns, detection\\ of a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it\\ backward compatible with early versions of the command programs that are used.\\ Note that the script is not fully tested with a full set of base firmware\\ command programs from all firmware versions. Users should consider upgrading\\ the command programs to the latest versions from the ipkg to guarantee the\\ correct functionality.

I have also used variables in place of program call paths to make it\\ easier for the script to be changed for different Linux distro’s.

to:

3. Script will detect fatal errors returned from DynDns, detection \\ of a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it \\ backward compatible with early versions of the command programs that are used. \\ Note that the script is not fully tested with a full set of base firmware \\ command programs from all firmware versions. Users should consider upgrading \\ the command programs to the latest versions from the ipkg to guarantee the \\ correct functionality.

I have also used variables in place of program call paths to make it \\ easier for the script to be changed for different Linux distro’s.

Changed lines 728-733 from:

Suggest that any potential users of this script version should first\\ check the functionality on there system using one the DynDns test\\ accounts before committing there own account details.

DynDns recommend the use of https so that user details and password\\ are encrypted, to use https users would need to install the Optware\\ packages openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump\\ the User-Agent script version to reflect these changes.

to:

Suggest that any potential users of this script version should first \\ check the functionality on there system using one the DynDns test \\ accounts before committing there own account details.

DynDns recommend the use of https so that user details and password \\ are encrypted, to use https users would need to install the Optware \\ packages openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump \\ the User-Agent script version to reflect these changes.

February 09, 2007, at 10:51 PM by RobHam -- Another improved - full feature script added
Changed lines 712-713 from:

Another version of MO's excellent script above expanded so that the script should comply with the DynDns Developers specification for an update client.

to:

Another version of MO's excellent script above expanded so that the\\ script should comply with the DynDns Developers specification for an update client.

Changed lines 720-725 from:

3. Script will detect fatal errors returned from DynDns, detection of a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it backward compatible with early versions of the command programs that are used. Note that the script is not fully tested with a full set of base firmware command programs from all firmware versions. Users should consider upgrading the command programs to the latest versions from the ipkg to guarantee the correct functionality.

I have also used variables in place of program call paths to make it easier for the script to be changed for different Linux distro’s.

to:

3. Script will detect fatal errors returned from DynDns, detection\\ of a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it\\ backward compatible with early versions of the command programs that are used.\\ Note that the script is not fully tested with a full set of base firmware\\ command programs from all firmware versions. Users should consider upgrading\\ the command programs to the latest versions from the ipkg to guarantee the\\ correct functionality.

I have also used variables in place of program call paths to make it\\ easier for the script to be changed for different Linux distro’s.

Changed lines 727-732 from:

Suggest that any potential users of this script version should first check the functionality on there system using one the DynDns test accounts before committing there own account details.

DynDns recommend the use of https so that user details and password are encrypted, to use https users would need to install the Optware packages openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump the User-Agent script version to reflect these changes.

to:

Suggest that any potential users of this script version should first\\ check the functionality on there system using one the DynDns test\\ accounts before committing there own account details.

DynDns recommend the use of https so that user details and password\\ are encrypted, to use https users would need to install the Optware\\ packages openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump\\ the User-Agent script version to reflect these changes.

February 09, 2007, at 10:46 PM by RobHam -- Another improved - full feature script added
Changed lines 727-728 from:

Suggest that any potential users of this script version should first check the functionality on there system using one the DynDns? test accounts before committing there own account details.

to:

Suggest that any potential users of this script version should first check the functionality on there system using one the DynDns test accounts before committing there own account details.

February 09, 2007, at 10:45 PM by RobHam -- Another improved - full feature script added
Changed line 666 from:

Under some rare circumstances it is possible that the slug wont be able to resolve the correct IP for the dyndns servers\\

to:

Under some rare circumstances it is possible that the slug wont be able to resolve the correct IP for the dyndns servers

Changed lines 689-692 from:

Users who have configured there /var folder to be stored on a ram disk\\ should modify the relevant parts of the scripts above so that the various\\ files are saved to the alternative folders /opt/var/log and\\ /opt/var/tmp. These two folders may need to be created by the user and\\ flagged with chmod 755.

Note that for user written scripts such as these, the recommended folder tree\\ to use with Unslung firmware is /opt/var.

to:

Users who have configured there /var folder to be stored on a ram disk should modify the relevant parts of the scripts above so that the various files are saved to the alternative folders /opt/var/log and /opt/var/tmp. These two folders may need to be created by the user and flagged with chmod 755.

Note that for user written scripts such as these, the recommended folder tree to use with Unslung firmware is /opt/var.

Changed lines 697-702 from:

I have unSlung 6.8 my slug and have tried most of the above but i keep geting\\ 401 Authorization Error, i have tested my members.dyndns.org url\\ in fire fox and it works ok. Any ideas any one?

--EDIT-- Fixed it, the default PATH statement needs to be modified if\\ using the ash shell (i.e. from Optware bash or busybox). There are two work\\ arounds to this :-

1. Change the script to use the default sh shell (but do note that the default\\ sh shell on the NSLU2 has limited functionality and has not been\\ tested with some of the scripts).

to:

I have unSlung 6.8 my slug and have tried most of the above but i keep geting 401 Authorization Error, i have tested my members.dyndns.org url in fire fox and it works ok. Any ideas any one?

--EDIT-- Fixed it, the default PATH statement needs to be modified if using the ash shell (i.e. from Optware bash or busybox). There are two work arounds to this :-

1. Change the script to use the default sh shell (but do note that the default sh shell on the NSLU2 has limited functionality and has not been tested with some of the scripts).

Changed lines 712-713 from:

Another version of MO's excellent script above expanded so that the script\\ should comply with the DynDns Developers specification for an update client.

to:

Another version of MO's excellent script above expanded so that the script should comply with the DynDns Developers specification for an update client.

Changed lines 720-725 from:

3. Script will detect fatal errors returned from DynDns, detection of\\ a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it backward\\ compatible with early versions of the command programs that are used.\\ Note that the script is not fully tested with a full set of base firmware command\\ programs from all firmware versions. Users should consider upgrading the\\ command programs to the latest versions from the ipkg to guarantee the correct\\ functionality.

I have also used variables in place of program call paths to make it easier\\ for the script to be changed for different Linux distro’s.

to:

3. Script will detect fatal errors returned from DynDns, detection of a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it backward compatible with early versions of the command programs that are used. Note that the script is not fully tested with a full set of base firmware command programs from all firmware versions. Users should consider upgrading the command programs to the latest versions from the ipkg to guarantee the correct functionality.

I have also used variables in place of program call paths to make it easier for the script to be changed for different Linux distro’s.

Changed lines 727-732 from:

Suggest that any potential users of this script version should first check the\\ functionality on there system using one the DynDns? test accounts before committing\\ there own account details.

DynDns recommend the use of https so that user details and password are\\ encrypted, to use https users would need to install the Optware packages\\ openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump the\\ User-Agent script version to reflect these changes.

to:

Suggest that any potential users of this script version should first check the functionality on there system using one the DynDns? test accounts before committing there own account details.

DynDns recommend the use of https so that user details and password are encrypted, to use https users would need to install the Optware packages openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump the User-Agent script version to reflect these changes.

February 09, 2007, at 10:41 PM by RobHam -- Another improved - full feature script added
Changed lines 689-692 from:

Users who have configured there /var folder to be stored on a ram disk should modify the relevant parts of the scripts above so that the various files are saved to the alternative folders /opt/var/log and /opt/var/tmp. These two folders may need to be created by the user and flagged with chmod 755.

Note that for user written scripts such as these, the recommended folder tree to use with Unslung firmware is /opt/var.

to:

Users who have configured there /var folder to be stored on a ram disk\\ should modify the relevant parts of the scripts above so that the various\\ files are saved to the alternative folders /opt/var/log and\\ /opt/var/tmp. These two folders may need to be created by the user and\\ flagged with chmod 755.

Note that for user written scripts such as these, the recommended folder tree\\ to use with Unslung firmware is /opt/var.

Changed lines 697-702 from:

I have unSlung 6.8 my slug and have tried most of the above but i keep geting 401 Authorization Error, i have tested my members.dyndns.org url in fire fox and it works ok. Any ideas any one?

--EDIT-- Fixed it, the default PATH statement needs to be modified if using the ash shell (i.e. from Optware bash or busybox). There are two work arounds to this :-

1. Change the script to use the default sh shell (but do note that the default sh shell on the NSLU2 has limited functionality and has not been tested with some of the scripts).

to:

I have unSlung 6.8 my slug and have tried most of the above but i keep geting\\ 401 Authorization Error, i have tested my members.dyndns.org url\\ in fire fox and it works ok. Any ideas any one?

--EDIT-- Fixed it, the default PATH statement needs to be modified if\\ using the ash shell (i.e. from Optware bash or busybox). There are two work\\ arounds to this :-

1. Change the script to use the default sh shell (but do note that the default\\ sh shell on the NSLU2 has limited functionality and has not been\\ tested with some of the scripts).

Changed lines 712-713 from:

Another version of MO's excellent script above expanded so that the script should comply with the DynDns Developers specification for an update client.

to:

Another version of MO's excellent script above expanded so that the script\\ should comply with the DynDns Developers specification for an update client.

Changed lines 720-725 from:

3. Script will detect fatal errors returned from DynDns, detection of a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it backward compatible with early versions of the command programs that are used. Note that the script is not fully tested with a full set of base firmware command programs from all firmware versions. Users should consider upgrading the command programs to the latest versions from the ipkg to guarantee the correct functionality.

I have also used variables in place of program call paths to make it easier for the script to be changed for different Linux distro’s.

to:

3. Script will detect fatal errors returned from DynDns, detection of\\ a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it backward\\ compatible with early versions of the command programs that are used.\\ Note that the script is not fully tested with a full set of base firmware command\\ programs from all firmware versions. Users should consider upgrading the\\ command programs to the latest versions from the ipkg to guarantee the correct\\ functionality.

I have also used variables in place of program call paths to make it easier\\ for the script to be changed for different Linux distro’s.

Changed lines 727-732 from:

Suggest that any potential users of this script version should first check the functionality on there system using one the DynDns? test accounts before committing there own account details.

DynDns? recommend the use of https so that user details and password are encrypted, to use https users would need to install the Optware packages openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump the User-Agent script version to reflect these changes.

to:

Suggest that any potential users of this script version should first check the\\ functionality on there system using one the DynDns? test accounts before committing\\ there own account details.

DynDns recommend the use of https so that user details and password are\\ encrypted, to use https users would need to install the Optware packages\\ openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump the\\ User-Agent script version to reflect these changes.

February 09, 2007, at 10:37 PM by RobHam -- Another improved - full feature script added
Changed lines 711-713 from:

Although all of the later scripts above are excellent and give ample functionality for most users, the scripts still break the client developers notes at DynDns because the script should also trigger an update if a parameter changes such as wildcard changed from off to on. So a future enhancement would be to save the user config parameters to a disk file so that any changes could be detected and hence trigger an update.

to:

Update: Feb 2007
Another version of MO's excellent script above expanded so that the script should comply with the DynDns Developers specification for an update client.

Functionality added: -

1. Script will update when a Users DynDns setting are change.

2. A formatted User-Agent string now included.

3. Script will detect fatal errors returned from DynDns, detection of a fatal error will disable the script.

There are a number of other minor changes mainly to try and make it backward compatible with early versions of the command programs that are used. Note that the script is not fully tested with a full set of base firmware command programs from all firmware versions. Users should consider upgrading the command programs to the latest versions from the ipkg to guarantee the correct functionality.

I have also used variables in place of program call paths to make it easier for the script to be changed for different Linux distro’s.

Suggest that any potential users of this script version should first check the functionality on there system using one the DynDns? test accounts before committing there own account details.

DynDns? recommend the use of https so that user details and password are encrypted, to use https users would need to install the Optware packages openssl and wget-ssl.

If a user corrects any errors with the script then they should also bump the User-Agent script version to reflect these changes.

(:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
#!/bin/sh
# DynDNS Update Client for the Linux NSLU2
#
# Script version - (used for user-agent)
VER=NSLU2-Linux-DNSUPD-0.9.1beta

# User configurable Section
#
# USER=<dnsuser>
# PASSWD=<dnspasswd>
# DOMAIN=<domain.name.org,domain2.name.org,domain3.name.org>
# SYSTEM=[dyndns|statdns|custom]
# WILDCARD=[ON|OFF|NOCHG]
# MX=[mailexchanger.name.org|NOCHG]
# BACKMX=[YES|NO|NOCHG]
# OFFLINE=[YES|NO] or leave blank

USER=test
PASSWD=test
DOMAIN=test.dyndns.org
SYSTEM=dyndns
WILDCARD=OFF
MX=NOCHG
BACKMX=NOCHG
OFFLINE=

# Var folder, Set VAR to either '/var' or '/opt/var', '/opt/var' recommended for Unslung users
VAR=/opt/var

# Update using either 'http' or 'https' (wget-ssl is needed for https)
HTTP=https
# For https set SSL=--no-check-certificate
SSL=--no-check-certificate

# Paths to program files
WGET=/opt/bin/wget
FIND=/opt/bin/find
CHMOD=/bin/chmod
MKDIR=/bin/chmod
GREP=/bin/grep
ECHO=/bin/echo
DATE=/bin/date
CAT=/bin/cat
SED=/bin/sed
CP=/bin/cp
RM=/bin/rm
# A beep command equivalent to 'printf "\a"'
BEEP='Set_Led beep1'

# Dyndns script update section
# 
# Check and create folders
if [ ! -d ${VAR}/log ]; then
${MKDIR} ${VAR}/log
${CHMOD} 755 ${VAR}/log
fi
if [ ! -d ${VAR}/tmp ]; then
${MKDIR} ${VAR}/tmp
${CHMOD} 755 ${VAR}/tmp
fi

# Check and create err.ip
if [ ! -f ${VAR}/tmp/err.ip ]
then
  ${ECHO} "off" > ${VAR}/tmp/err.ip
fi

# Check for Fatal error file,  disable script and error beep if file exists
if [ -f ${VAR}/log/dyndns.fatal.error ]
then
  ${BEEP}
  ${BEEP}
  exit 0
fi

# Fetch current IP Address.
${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/now.ip http://checkip.dyndns.com:8245/
# Verify the data is good.
PAT='Current IP Address: *[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'
if ${GREP} "$PAT" ${VAR}/tmp/now.ip >/dev/null;
then
  MYIP="${SED} -e 's|.*Address: ||; s|</body>.*||' ${VAR}/tmp/now.ip"
  # On good IP data.
  # Check for IP history.
  if [ -f ${VAR}/tmp/old.ip ]
  then
    # On history found.
    if [ "`${CAT} ${VAR}/tmp/err.ip`" = "on" ]
    then
      ${ECHO} "`${DATE} +%Y%m%d.%H%M%S` - not updated: Network connection restored." >> ${VAR}/log/ip_hist.log;
      # Turn err.ip Off
      ${ECHO} "off" > ${VAR}/tmp/err.ip
    fi
    # Check for settings change
    if [ ! "`${CAT} ${VAR}/tmp/update.para`" = "${USER}:${PASSWD}:${DOMAIN}:${SYSTEM}:${WILDCARD}:${MX}:${BACKMX}:${OFFLINE}:" ]
    then 
      ${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
      # Log the settings change and notify user.
      ${ECHO} "`${DATE} +%Y%m%d.%H%M%S` - Settings - `${CAT} ${VAR}/tmp/upd.ip`" >> ${VAR}/log/ip_hist.log;
      ${ECHO} "`${DATE} +%x`" > ${VAR}/tmp/day.ip;
      ${RM} -f ${VAR}/tmp/old.ip;
      ${CP} ${VAR}/tmp/now.ip ${VAR}/tmp/old.ip;
      ${ECHO} "${USER}:${PASSWD}:${DOMAIN}:${SYSTEM}:${WILDCARD}:${MX}:${BACKMX}:${OFFLINE}:" > ${VAR}/tmp/update.para;
      ${BEEP}
    fi
    # Check for IP Change
    if [ "`${CAT} ${VAR}/tmp/now.ip`" = "`${CAT} ${VAR}/tmp/old.ip`" ]
    then
      # On no IP change
      # Check if 28 day refresh is needed.
      ${FIND} ${VAR}/tmp/ -name old.ip -mtime +28 -exec ${RM} {} \;
      if  [ -f ${VAR}/tmp/old.ip ]
      then
        # On no refresh needed.
        # Check for Next day. 
        if [ ! "`${CAT} ${VAR}/tmp/day.ip`" = "`${DATE} +%x`" ]
        then
          # On day change
          # Log entry
          ${ECHO} "`${DATE} +%Y%m%d.%H%M%S` - No update - `${CAT} ${VAR}/tmp/upd.ip`" >> ${VAR}/log/ip_hist.log;
          ${ECHO} "`${DATE} +%x`" > ${VAR}/tmp/day.ip;
        fi
      else
        # On refresh needed.
        # Do a 28 Day refresh and Notify user with a distinguishable beep.
        ${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
        echo "`${DATE} +%Y%m%d.%H%M%S` - Refresh - `${CAT} ${VAR}/tmp/upd.ip`" >> ${VAR}/log/ip_hist.log;
        echo "`${DATE} +%x`" > ${VAR}/tmp/day.ip;
        ${CP} ${VAR}/tmp/now.ip ${VAR}/tmp/old.ip;
        ${BEEP}
      fi
    else
      # On IP change
      # Update DynDNS with new IP Address. 
      ${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
      # Log the IP change and notify user.
      ${ECHO} "`${DATE} +%Y%m%d.%H%M%S` - Update - `${CAT} ${VAR}/tmp/upd.ip`" >> ${VAR}/log/ip_hist.log;
      ${ECHO} "`${DATE} +%x`" > ${VAR}/tmp/day.ip;
      ${RM} -f ${VAR}/tmp/old.ip;
      ${CP} ${VAR}/tmp/now.ip ${VAR}/tmp/old.ip;
      ${BEEP}
    fi
  else
    # On No History
    # Initialize client and Update DynDNS.
    # Check err.ip status
    if [ "`${CAT} ${VAR}/tmp/err.ip`" = "on" ]
    then
      # Log Service Restoral.
      ${ECHO} "`${DATE} +%Y%m%d.%H%M%S` - not updated: Network connection restored." >> ${VAR}/log/ip_hist.log;
    fi
    # Set err.ip off
    ${ECHO} "off" > ${VAR}/tmp/err.ip
    ${WGET} -q -t 0 -T 30 -U ${VER} -O ${VAR}/tmp/upd.ip ${SSL} "${HTTP}://${USER}:${PASSWD}@members.dyndns.org/nic/update?system=${SYSTEM}&hostname=${DOMAIN}&myip=${MYIP}&wildcard=${WILDCARD}&mx=${MX}&backmx=${BACKMX}&offline=${OFFLINE}";
    ${ECHO} "`${DATE} +%Y%m%d.%H%M%S` - Initialise - `${CAT} ${VAR}/tmp/upd.ip`" >> ${VAR}/log/ip_hist.log;
    ${ECHO} "`${DATE} +%x`" > ${VAR}/tmp/day.ip;
    ${CP} ${VAR}/tmp/now.ip ${VAR}/tmp/old.ip;
    ${ECHO} "${USER}:${PASSWD}:${DOMAIN}:${SYSTEM}:${WILDCARD}:${MX}:${BACKMX}:${OFFLINE}:" > ${VAR}/tmp/update.para
    ${BEEP}
  fi
  # Analyse and report any Fatal error return strings
  if ${GREP} "\!yours\|notfqdn\|abuse\|nohost\|nochg\|badagent\|badauth\|badsys" ${VAR}/tmp/upd.ip >/dev/null
  then
    ${ECHO} "`${DATE} +%x` - Fatal Error Returned from Dyndns - `${CAT} ${VAR}/tmp/upd.ip` - Correct the error then delete this file to re-enable" > ${VAR}/log/dyndns.fatal.error;
    ${BEEP}
    ${BEEP}
    #
    # Place holder - for example - to send fatal error report by email
    #
  fi
else
  # On IP read error
  # Check err.ip status
  if [ ! "`${CAT} ${VAR}/tmp/err.ip`" = "on" ]
  then
    # On err.ip = off - Log read error. 
    ${ECHO} "`${DATE} +%Y%m%d.%H%M%S` - not updated: read error on ip fetch" >> ${VAR}/log/ip_hist.log;
  fi
  # Set err.ip = On to allow only one error log on next run.
  ${ECHO} "on" > ${VAR}/tmp/err.ip
  # Notify user.
  ${BEEP}
  ${BEEP}
fi
# end
# Set the interval of the next IP check using a crontab entry.
# Once every 15 minutes is good for a home server.
# */15 * * * * root /opt/bin/dnsupd &>/dev/null
#

(:tableend:)

February 07, 2007, at 09:45 PM by RobHam -- checkip.dyndns.org changed to checkip.dyndns.com ref dyndns developers notes
Changed line 17 from:
 wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
to:
 wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/new.ip
Changed line 92 from:
 wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/tmp.ip
to:
 wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/tmp.ip
Changed line 137 from:
 then wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
to:
 then wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/new.ip
Changed line 158 from:

If your NSLU2 is behind a transparent proxy, http://checkip.dyndns.org

to:

If your NSLU2 is behind a transparent proxy, http://checkip.dyndns.com

Changed line 162 from:

RobHam has recommended the use of port 8245

to:

DynDns recommend the use of port 8245

Changed lines 165-166 from:

http://checkip.dyndns.org:8245/index.html

to:

http://checkip.dyndns.com:8245/index.html

Changed line 207 from:
  wget -q http://checkip.dyndns.org:8245/index.html --output-document=/var/tmp/new.ip
to:
  wget -q http://checkip.dyndns.com:8245/index.html --output-document=/var/tmp/new.ip
Changed line 256 from:
 wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
to:
 wget -q http://checkip.dyndns.com/index.html --output-document=/var/tmp/new.ip
Changed lines 293-294 from:

newip=`wget -q -O - http://checkip.dyndns.org/index.html | tr "<" " " | tr ">" " " | sed 's/\(^.* \)\([0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}\)\(.*\)/\2/g'`

to:

newip=`wget -q -O - http://checkip.dyndns.com/index.html | tr "<" " " | tr ">" " " | sed 's/\(^.* \)\([0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}\)\(.*\)/\2/g'`

Changed line 335 from:

/opt/bin/wget --quiet http://checkip.dyndns.org/ --output-document=/var/tmp/now.ip;

to:

/opt/bin/wget --quiet http://checkip.dyndns.com/ --output-document=/var/tmp/now.ip;

Changed line 401 from:

/opt/bin/wget --quiet http://checkip.dyndns.org/ --output-document=/var/tmp/now.ip;

to:

/opt/bin/wget --quiet http://checkip.dyndns.com/ --output-document=/var/tmp/now.ip;

Changed lines 466-467 from:

/opt/bin/wget --quiet http://checkip.dyndns.org/ --output-document=/var/log/router_ip;

to:

/opt/bin/wget --quiet http://checkip.dyndns.com/ --output-document=/var/log/router_ip;

Changed line 556 from:

/opt/bin/wget --quiet http://checkip.dyndns.org/ --output-document=/var/tmp/now.ip;

to:

/opt/bin/wget --quiet http://checkip.dyndns.com/ --output-document=/var/tmp/now.ip;

Changed lines 699-700 from:

--EDIT-- Fixed it, the default PATH statement needs to be modified if using the ash shell (i.e. from Optware bash). There are two work arounds to this :-

to:

--EDIT-- Fixed it, the default PATH statement needs to be modified if using the ash shell (i.e. from Optware bash or busybox). There are two work arounds to this :-

February 05, 2007, at 04:33 PM by Peter Taylor -- Corrected some language \"issues\"
Changed line 1 from:

I have add a workaround to update the dyndns.org service, because my DSL-Router have no option for this.\\

to:

I have added a workaround to update the dyndns.org service, as my DSL-Router has no option to do this.\\

Changed line 8 from:

if not exists /var/tmp create it:

to:

if /var/tmp does not exist create it:

Changed line 127 from:

Find a complette solution below, to run only every 28 days:

to:

Find a complete solution below, to run only every 28 days:

Changed lines 280-283 from:

This is my litle dirty solution. A read-only-methode. (testet on openslug 2.7)

to:

This is my litle dirty solution. A read-only-method. (tested on openslug 2.7)

February 02, 2007, at 08:16 PM by RobHam -- Mention of Unslung firware in the @@/var /opt/var@@ note section
Changed lines 691-692 from:

Note that for user written scripts such as these and Optware programs, the recommended folder tree to use is /opt/var.

to:

Note that for user written scripts such as these, the recommended folder tree to use with Unslung firmware is /opt/var.

Changed lines 711-713 from:

Although all of the later scripts above are excellent and give ample functionality for most users, the scripts still break the client developers notes at DynDns because the script should also trigger an update if a parameter changes such as wildcard changed from off to on. So a future improvement would be to save the user config parameters to a disk file so that any changes could be detected and hence trigger an update.

to:

Although all of the later scripts above are excellent and give ample functionality for most users, the scripts still break the client developers notes at DynDns because the script should also trigger an update if a parameter changes such as wildcard changed from off to on. So a future enhancement would be to save the user config parameters to a disk file so that any changes could be detected and hence trigger an update.

February 02, 2007, at 06:43 PM by RobHam -- Note added regarding ash shell and Note regarding future enhancement
Changed line 543 from:

DOMAIN=<domain.name.org>

to:

DOMAIN=<domain.name.org,domain2.name.org,domain3.name.org>

Changed lines 699-708 from:

--EDIT-- Fixed it, the PATH statement was not saving my changes

Hutchweb

=====================

I am also using UnSlung? 6.8 and I am getting 401 Authorization error. What am I doing wrong? I did not understand the previous post "PATH fix" ?

Thanks in advance. NJ

to:

--EDIT-- Fixed it, the default PATH statement needs to be modified if using the ash shell (i.e. from Optware bash). There are two work arounds to this :-

1. Change the script to use the default sh shell (but do note that the default sh shell on the NSLU2 has limited functionality and has not been tested with some of the scripts).

2. Create a profile file /etc/profile and add the following line

export PATH=/opt/sbin:/opt/bin:${PATH}

Hutchweb - modified by RobHam


Although all of the later scripts above are excellent and give ample functionality for most users, the scripts still break the client developers notes at DynDns because the script should also trigger an update if a parameter changes such as wildcard changed from off to on. So a future improvement would be to save the user config parameters to a disk file so that any changes could be detected and hence trigger an update.

RobHam


February 02, 2007, at 04:19 AM by NJ --
Changed lines 705-706 from:

I am also using UnSlung? 6.8 and I am getting 401 Authorization error. What is the issue ? I did not understand the previous post PATH fix ?

to:

I am also using UnSlung? 6.8 and I am getting 401 Authorization error. What am I doing wrong? I did not understand the previous post "PATH fix" ?

February 02, 2007, at 04:18 AM by NJ --
Changed lines 707-708 from:

Thanks in advance.

to:

Thanks in advance. NJ

February 02, 2007, at 04:18 AM by NJ --
Changed lines 701-707 from:

Hutchweb

to:

Hutchweb

=====================

I am also using UnSlung? 6.8 and I am getting 401 Authorization error. What is the issue ? I did not understand the previous post PATH fix ?

Thanks in advance.

February 01, 2007, at 10:07 PM by RobHam -- Added note regarding the use of @@/opt/var@@ folder tree
Changed line 136 from:
 if [ "`ls -l --time-style=+%Y-%m-%d /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'%m-%d'`" ]
to:
 if [ "`ls -l --time-style=+m-%d /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'d'`" ]
February 01, 2007, at 10:02 PM by RobHam -- Added note regarding the use of @@/opt/var@@ folder tree
Changed line 134 from:
 #!/bin/ash
to:
  1. !/bin/ash
February 01, 2007, at 09:59 PM by RobHam -- Added note regarding the use of @@/opt/var@@ folder tree
Added line 133:
 [=
Added line 149:

=]

February 01, 2007, at 09:53 PM by RobHam -- Added note regarding the use of @@/opt/var@@ folder tree
Changed line 188 from:

[=

to:
 [=
Changed line 664 from:

Under some rare circumstances it is possible that the slug wont be able to resolve the correct IPs? for the dyndns servers\\

to:

Under some rare circumstances it is possible that the slug wont be able to resolve the correct IP for the dyndns servers\\

February 01, 2007, at 09:44 PM by RobHam -- Added note regarding the use of @@/opt/var@@ folder tree
Changed line 173 from:

The copied-pasted 28-day complete solution script above didn't work for me on Unslung 4 beta, perhaps because of plain old vanilla non-upgraded ls built-into BusyBox? v0.60.4. It gave error "EOF: back quote parsing error" and complained about --time-style option being invalid option for ls. I changed the output of date command to match output of ls.

to:

The copied-pasted 28-day complete solution script above didn't work for me on Unslung 4 beta, perhaps because of plain old vanilla non-upgraded ls built-into BusyBox v0.60.4. It gave error "EOF: back quote parsing error" and complained about --time-style option being invalid option for ls. I changed the output of date command to match output of ls.

Changed line 180 from:

Here is modified script that does the above and works with limited ls from BusyBox? that comes with Unslung 4 beta binary.

to:

Here is modified script that does the above and works with limited ls from BusyBox that comes with Unslung 4 beta binary.

Changed line 182 from:

Of course, the script needs to be scheduled to run on regular intervals in crontab to fulfill its purposes. DynDNS website does not allow/recommend checking IP with them more often than every 10 minutes.

to:

Of course, the script needs to be scheduled to run on regular intervals in crontab to fulfill its purposes. DynDNS website does not allow/recommend checking IP with them more often than every 10 minutes.

Changed lines 307-308 from:

SPoner March 06, 2006, at 05:31 PM

to:

SPoner March 06, 2006, at 05:31 PM

Changed lines 322-323 from:

It works great with uNSLUng 6.8 and wget-ssl.
Uses slick file find and logic to refresh the DynDNS Account if there is\\

to:

It works great with uNSLUng 6.8 and wget-ssl.
Uses slick file find and logic to refresh the DynDNS Account if there is\\

Changed line 590 from:
        /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcards=${WILDCARD}" --output-document=/var/tmp/upd.ip;
to:
        /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
Changed line 603 from:
      /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcards=${WILDCARD}" --output-document=/var/tmp/upd.ip;
to:
      /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
Changed line 624 from:
    /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcards=${WILDCARD}" --output-document=/var/tmp/upd.ip;
to:
    /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
Changed lines 677-678 from:
to:

JuergenS

Added lines 687-694:

Users who have configured there /var folder to be stored on a ram disk should modify the relevant parts of the scripts above so that the various files are saved to the alternative folders /opt/var/log and /opt/var/tmp. These two folders may need to be created by the user and flagged with chmod 755.

Note that for user written scripts such as these and Optware programs, the recommended folder tree to use is /opt/var.

RobHam


January 31, 2007, at 11:42 PM by fcarolo --
Changed lines 77-78 from:

http://USERNAME:PASSWORD@members.dyndns.org/nic/update?system=custom&hostname=DOMAINNAME.COM

to:

http://USERNAME:PASSWORD@members.dyndns.org/nic/update?system=custom&hostname=DOMAINNAME.COM

Changed lines 156-157 from:

If your NSLU2 is behind a transparent proxy, http://checkip.dyndns.org and http://members.dyndns.org may return/update

to:

If your NSLU2 is behind a transparent proxy, http://checkip.dyndns.org and http://members.dyndns.org may return/update

Changed lines 163-166 from:

http://checkip.dyndns.org:8245/index.html

http//<login>:<password>@members.dyndns.org:8245/nic/update?hostname=<yourDynHostName>

to:

http://checkip.dyndns.org:8245/index.html

http//<login>:<password>@members.dyndns.org:8245/nic/update?hostname=<yourDynHostName>

Added line 188:

[=

Changed lines 191-195 from:

if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days /var/tmp/exp.ip; fi

if [ "`ls -l /var/tmp/exp.ip |cut -b44-49`" = "`date --date="-28 days" +'e'`" ] then

to:
 if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days /var/tmp/exp.ip;
 fi

 if [ "`ls -l /var/tmp/exp.ip |cut -b44-49`" = "`date --date="-28 days" +'e'`" ]
 then
Changed line 203 from:

else

to:
 else
Changed lines 216-217 from:

fi

to:
 fi

=]

September 21, 2006, at 07:49 AM by Hutchyweb --
Changed lines 685-686 from:

I have unSlung 6.8 my slug and have tried most of the above but i keep geting 401 Authorization Error, i have tested my members.dyndns.org url in fire fox and it works ok. Any ideas any one? --EDIT-- Fixed it, the PATH statement was not saving my changes

to:

I have unSlung 6.8 my slug and have tried most of the above but i keep geting 401 Authorization Error, i have tested my members.dyndns.org url in fire fox and it works ok. Any ideas any one?

--EDIT-- Fixed it, the PATH statement was not saving my changes

September 21, 2006, at 07:49 AM by Hutchyweb --
Changed lines 685-687 from:

I have unSlung 6.8 my slug and have tried most of the above but i keep geting 401 Authorization Error, i have tested my members.dyndns.org url in fire fox and it works ok. Any ideas any one?

Hutchyweb

to:

I have unSlung 6.8 my slug and have tried most of the above but i keep geting 401 Authorization Error, i have tested my members.dyndns.org url in fire fox and it works ok. Any ideas any one? --EDIT-- Fixed it, the PATH statement was not saving my changes

Hutchweb

September 18, 2006, at 10:56 AM by Hutchyweb -- DynDns Update Errors
Added lines 682-687:

I have unSlung 6.8 my slug and have tried most of the above but i keep geting 401 Authorization Error, i have tested my members.dyndns.org url in fire fox and it works ok. Any ideas any one?

Hutchyweb

August 27, 2006, at 11:12 PM by Dimtiris --
Changed lines 675-681 from:
to:

JuergenS?


https works for members.dyndns.org/nic/update and protects your password.

Dimitris

August 05, 2006, at 09:26 AM by JuergenS --
Changed lines 662-663 from:

Under some rare circumstances it is possible that the slug wont be able to resolve the correct IPs? for the dyndns servers and the script gets stuck. This could be prevent by two simple lines at the start of the script:

to:

Under some rare circumstances it is possible that the slug wont be able to resolve the correct IPs? for the dyndns servers
and the script gets stuck. This could be prevent by two simple lines at the start of the script:

August 05, 2006, at 09:25 AM by JuergenS -- Ensure correct IP resolving for the dyndns servers
Added lines 655-674:

Hi,

great little script - very usefull. Thank you very much for this one!

Under some rare circumstances it is possible that the slug wont be able to resolve the correct IPs? for the dyndns servers and the script gets stuck. This could be prevent by two simple lines at the start of the script:

(:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
/opt/bin/ping -c 1 checkip.dyndns.org\\
/opt/bin/ping -c 1 members.dyndns.org\\

(:tableend:)
Hope this helps a bit.

JuergenS?

August 03, 2006, at 10:01 PM by Mo --
Changed lines 543-550 from:
to:
  1. Version: 08/03/2006
  2. Look for err.ip

if [ ! -f /var/tmp/err.ip ] then

  1. On err.ip not found.
    1. Set up err.ip for error logging.
    echo "off" > /var/tmp/err.ip

fi

Changed lines 562-563 from:
    # Check for IP Change
    if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ]
to:
    if [ "`cat /var/tmp/err.ip`" = "on" ]
Added lines 564-570:
      echo "`date +mHS` - not updated: Network connection restored." >> /var/log/ip_hist.log;
      # Turn err.ip Off
      echo "off" > /var/tmp/err.ip
    fi
    # Check for IP Change
    if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ]
    then
Added lines 614-621:
    # Check err.ip status
    if [ "`cat /var/tmp/err.ip`" = "on" ]
    then
    # Log Service Restoral.
      echo "`date +mHS` - not updated: Network connection restored." >> /var/log/ip_hist.log;
    fi
    # Set err.ip off
    echo "off" > /var/tmp/err.ip
Changed lines 629-630 from:
  # Log error and notify user with a distinguishable beep.
  echo "`date +mHS` - not updated: read error on ip fetch" >> /var/log/ip_hist.log;
to:
  # Check err.ip status
  if [ ! "`cat /var/tmp/err.ip`" = "on" ]
  then
  # On err.ip = off - Log read error. 
    echo "`date +mHS` - not updated: read error on ip fetch" >> /var/log/ip_hist.log;
  fi
  # Set err.ip = On to allow only one error log on next run.
  echo "on" > /var/tmp/err.ip
  # Notify user.
Added line 640:
  1. end
July 30, 2006, at 07:05 PM by Mo --
Changed line 576 from:
        echo "`date +mHS` - Refresh - `cat /var/tmp/upd.ip` - `cat /var/tmp/now.ip`" >> /var/log/ip_hist.log;
to:
        echo "`date +mHS` - Refresh - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
Deleted line 613:
July 30, 2006, at 07:00 PM by Mo --
Changed line 569 from:
          echo "`date +mHS` - `cat /var/tmp/now.ip` not updated" >> /var/log/ip_hist.log;
to:
          echo "`date +mHS` - No update - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
Changed line 576 from:
        echo "`date +mHS` - `cat /var/tmp/now.ip` - refreshed - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
to:
        echo "`date +mHS` - Refresh - `cat /var/tmp/upd.ip` - `cat /var/tmp/now.ip`" >> /var/log/ip_hist.log;
Changed line 590 from:
      echo "`date +mHS` - `cat /var/tmp/now.ip` - updated from `cat /var/tmp/old.ip` - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
to:
      echo "`date +mHS` - update - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
Changed line 602 from:
    echo "`date +mHS` - `cat /var/tmp/now.ip` - initialized - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
to:
    echo "`date +mHS` - initialization - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
Changed line 609 from:
  echo "`date +mHS` - `cat /var/tmp/now.ip` - not updated: read error on ip fetch" >> /var/log/ip_hist.log;
to:
  echo "`date +mHS` - not updated: read error on ip fetch" >> /var/log/ip_hist.log;
July 30, 2006, at 05:11 PM by Mo --
Changed line 621 from:

belongs in /var/tmp/. I changed date +%w to date +%x, just in\\

to:

belong in /var/tmp/. I changed date +%w to date +%x, just in\\

July 30, 2006, at 05:09 PM by Mo --
Changed line 621 from:

belongs in /var/tmp/. I changed date +%w to date +%x Just in\\

to:

belongs in /var/tmp/. I changed date +%w to date +%x, just in\\

July 30, 2006, at 05:04 PM by Mo --
Changed line 620 from:

the actual log file: ip_hist.log in in /var/log/. I think all the .ip files\\

to:

the actual log file: ip_hist.log into the directory /var/log/. I think all the .ip files\\

July 30, 2006, at 05:02 PM by Mo --
Changed lines 620-622 from:

the actual log file in /var/log/ip_hist.log. I thing everything else
belongs in /var/tmp/*.ip. Also changed date +%w to date +%x Just in
case the slug experiences a T.K.O. for exactly 1 week.

to:

the actual log file: ip_hist.log in in /var/log/. I think all the .ip files
belongs in /var/tmp/. I changed date +%w to date +%x Just in
case the slug experiences a T.K.O. for exactly 1 week, and I also made a couple
of other minor adjustments in logic flow.

July 30, 2006, at 05:26 AM by Mo --
Changed lines 531-532 from:

with it, but if anyone wants to through in a kitchen sink... Great!

to:

with it, but if anyone wants to throw in a kitchen sink... Great!

July 30, 2006, at 05:23 AM by Mo --
Changed lines 525-528 from:

Thank you, both Neil and Dutch for the improvements. Not to complain, but Dutch's script has a couple of minor
errors so I am reposting my script and incorporating Neil's common variables and Dutch's Logging. This script passed
my test of all features. I am pleased with it, but if anyone has a kitchen sink to add... Well OK!

to:

Update: 7/30/2006
Thank you, both Neil and Dutch for the improvements. I consider this
script to be a wonderful example of what people can accomplish when
they give without asking anything in return. I am reposting my
script and incorporating Neil's common variables and Dutch's logging.
This improved script passed my test of each feature. I am pleased
with it, but if anyone wants to through in a kitchen sink... Great!

Changed lines 535-536 from:
  1. !/bin/sh
to:
  1. !/bin/ash
Changed lines 548-552 from:
  if grep -q "$PAT" /var/tmp/now.ip;
to:

if grep -q "$PAT" /var/tmp/now.ip; then

  1. On good IP data.
    1. Check for IP history.
    if [ -f /var/tmp/old.ip ]
Changed lines 554-556 from:
  # On Good data.
    # Check for history.
    if [ -f /var/tmp/old.ip ]
to:
  # On history found.
    # Check for IP Change
    if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ]
Changed lines 558-562 from:
    # On History found.
      # Check for IP Change
      if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ]
      then
      # On no IP change
to:
    # On no IP change
Changed lines 560-561 from:
        /opt/bin/find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
        if  [ -f /var/tmp/old.ip ]
to:
      /opt/bin/find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
      if  [ -f /var/tmp/old.ip ]
      then
      # On no refresh needed.
        # Check for Next day. 
        if [ ! "`cat /var/tmp/day.ip`" = "`date +%x`" ]
Changed lines 567-585 from:
        # No refresh needed.
          # Log entry once each day, even if no IP change. 
          if [ ! "`cat /var/tmp/day.ip`" = "`date +%w`" ]
          then
            echo "`date +mHS` - `cat /var/tmp/now.ip` not updated" >> /var/log/ip_hist.log;
            echo "`date +%w`" > /var/tmp/day.ip;
          fi
        else
        # Refresh needed.
          # Do a 28 Day refresh and Notify user with a distinguishable beep.
          /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcards=${WILDCARD}" --output-document=/var/tmp/upd.ip;
          echo "`date +mHS` - `cat /var/tmp/now.ip` - refreshed - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
          echo "`date +%w`" > /var/tmp/day.ip;
          cp /var/tmp/now.ip /var/tmp/old.ip;
          Set_Led beep1
          Set_Led beep1
          Set_Led beep1
          Set_Led beep1
          Set_Led beep1
to:
        # On day change
          # Log entry
          echo "`date +mHS` - `cat /var/tmp/now.ip` not updated" >> /var/log/ip_hist.log;
          echo "`date +%x`" > /var/tmp/day.ip;
Changed lines 573-574 from:
      # On IP change
        # Updating DynDNS with new IP Address. 
to:
      # On refresh needed.
        # Do a 28 Day refresh and Notify user with a distinguishable beep.
Changed lines 576-578 from:
        # Log the IP change.
        echo "`date +mHS` - `cat /var/tmp/now.ip` - updated from `cat /var/tmp/old.ip` - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
        echo "`date +%w`" > /var/tmp/day.ip;
to:
        echo "`date +mHS` - `cat /var/tmp/now.ip` - refreshed - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
        echo "`date +%x`" > /var/tmp/day.ip;
        cp /var/tmp/now.ip /var/tmp/old.ip;
Changed lines 582-583 from:
        rm -f /var/tmp/old.ip;
        cp /var/tmp/now.ip /var/tmp/old.ip;
to:
        Set_Led beep1
        Set_Led beep1
Changed lines 586-587 from:
    # No History - Program initialization for DynDNS Update Client.
to:
    # On IP change
      # Update DynDNS with new IP Address. 
Changed lines 589-590 from:
      echo "`date +mHS` - `cat /var/tmp/now.ip` - initialized - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
      echo "`date +%w`" > /var/tmp/day.ip;
to:
      # Log the IP change and notify user.
      echo "`date +mHS` - `cat /var/tmp/now.ip` - updated from `cat /var/tmp/old.ip` - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
      echo "`date +%x`" > /var/tmp/day.ip;
      rm -f /var/tmp/old.ip;
Added lines 594-596:
      Set_Led beep1
      Set_Led beep1
      Set_Led beep1
Changed lines 599-601 from:
  # On IP read error - Log error and notify user with a distinguishable beep.
    echo "`date +mHS` - `cat /var/tmp/now.ip` - not updated: read error on ip fetch" >> /var/log/ip_hist.log;
    Set_Led beep2
to:
  # On No History
    # Initialize client and Update DynDNS.
    /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcards=${WILDCARD}" --output-document=/var/tmp/upd.ip;
    echo "`date +mHS` - `cat /var/tmp/now.ip` - initialized - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
    echo "`date +%x`" > /var/tmp/day.ip;
    cp /var/tmp/now.ip /var/tmp/old.ip;
Changed lines 606-608 from:
  1. You will need to Set the interval of the next check using a crontab entry.
  2. Once every 15 minutes is a good setting for a home server.
to:

else

  1. On IP read error
    1. Log error and notify user with a distinguishable beep.
    echo "`date +mHS` - `cat /var/tmp/now.ip` - not updated: read error on ip fetch" >> /var/log/ip_hist.log; Set_Led beep2

fi

  1. Set the interval of the next IP check using a crontab entry.
  2. Once every 15 minutes is good for a home server.
Changed lines 619-620 from:

The log file is helpful!

to:

The log file is extremely helpful! But, unlike Dutch's script, I put only
the actual log file in /var/log/ip_hist.log. I thing everything else
belongs in /var/tmp/*.ip. Also changed date +%w to date +%x Just in
case the slug experiences a T.K.O. for exactly 1 week.

July 29, 2006, at 09:11 PM by Mo --
Changed line 525 from:

Thanks you, both Neil and Dutch for the improvements. Not to complain, but Dutch's script has a couple of minor\\

to:

Thank you, both Neil and Dutch for the improvements. Not to complain, but Dutch's script has a couple of minor\\

July 29, 2006, at 07:15 AM by Mo --
Changed lines 525-528 from:

Thanks you, both Neil and Dutch for the improvements. Dutch's script has a couple of minor errors so I am reposting my
script and incorporating Neil's common variables and Dutch's Logging. This script passed my test of all features.
I am pleased with it, but if anyone has a kitchen sink to add... Well ok!

to:

Thanks you, both Neil and Dutch for the improvements. Not to complain, but Dutch's script has a couple of minor
errors so I am reposting my script and incorporating Neil's common variables and Dutch's Logging. This script passed
my test of all features. I am pleased with it, but if anyone has a kitchen sink to add... Well OK!

July 29, 2006, at 07:02 AM by Mo --
Changed lines 527-528 from:

I am pleased with it, but if anyone has a kitchen synk to add... Well ok!

to:

I am pleased with it, but if anyone has a kitchen sink to add... Well ok!

July 29, 2006, at 07:01 AM by Mo --
Changed lines 525-526 from:

Thanks you, both Neil and Dutch for the improvements. Dutch's script has a couple of minor errors so I am reposting my script and incorporating Neil's common variables and Dutch's Logging. This script passed my test of all features. I am pleased with it, but if anyone has a kitchen synk to add... Well ok!

to:

Thanks you, both Neil and Dutch for the improvements. Dutch's script has a couple of minor errors so I am reposting my
script and incorporating Neil's common variables and Dutch's Logging. This script passed my test of all features.
I am pleased with it, but if anyone has a kitchen synk to add... Well ok!

July 29, 2006, at 06:57 AM by Mo --
Added lines 522-613:

Thanks you, both Neil and Dutch for the improvements. Dutch's script has a couple of minor errors so I am reposting my script and incorporating Neil's common variables and Dutch's Logging. This script passed my test of all features. I am pleased with it, but if anyone has a kitchen synk to add... Well ok!

(:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
#!/bin/sh

USER=<dnsuser>
PASSWD=<dnspasswd>
DOMAIN=<domain.name.org>
WILDCARD=[ON|OFF]

# DynDNS Update Client for the Slug
#
# Fetch current IP Address.
/opt/bin/wget --quiet http://checkip.dyndns.org/ --output-document=/var/tmp/now.ip;
# Verify the data is good.
PAT='Current IP Address: *[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'
  if grep -q "$PAT" /var/tmp/now.ip;
  then
  # On Good data.
    # Check for history.
    if [ -f /var/tmp/old.ip ]
    then
    # On History found.
      # Check for IP Change
      if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ]
      then
      # On no IP change
      # Check if 28 day refresh is needed.
        /opt/bin/find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
        if  [ -f /var/tmp/old.ip ]
        then
        # No refresh needed.
          # Log entry once each day, even if no IP change. 
          if [ ! "`cat /var/tmp/day.ip`" = "`date +%w`" ]
          then
            echo "`date +%Y%m%d.%H%M%S` - `cat /var/tmp/now.ip` not updated" >> /var/log/ip_hist.log;
            echo "`date +%w`" > /var/tmp/day.ip;
          fi
        else
        # Refresh needed.
          # Do a 28 Day refresh and Notify user with a distinguishable beep.
          /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcards=${WILDCARD}" --output-document=/var/tmp/upd.ip;
          echo "`date +%Y%m%d.%H%M%S` - `cat /var/tmp/now.ip` - refreshed - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
          echo "`date +%w`" > /var/tmp/day.ip;
          cp /var/tmp/now.ip /var/tmp/old.ip;
          Set_Led beep1
          Set_Led beep1
          Set_Led beep1
          Set_Led beep1
          Set_Led beep1
        fi
      else
      # On IP change
        # Updating DynDNS with new IP Address. 
        /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcards=${WILDCARD}" --output-document=/var/tmp/upd.ip;
        # Log the IP change.
        echo "`date +%Y%m%d.%H%M%S` - `cat /var/tmp/now.ip` - updated from `cat /var/tmp/old.ip` - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
        echo "`date +%w`" > /var/tmp/day.ip;
        Set_Led beep1
        Set_Led beep1
        Set_Led beep1
        rm -f /var/tmp/old.ip;
        cp /var/tmp/now.ip /var/tmp/old.ip;
      fi
    else
    # No History - Program initialization for DynDNS Update Client.
      /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcards=${WILDCARD}" --output-document=/var/tmp/upd.ip;
      echo "`date +%Y%m%d.%H%M%S` - `cat /var/tmp/now.ip` - initialized - `cat /var/tmp/upd.ip`" >> /var/log/ip_hist.log;
      echo "`date +%w`" > /var/tmp/day.ip;
      cp /var/tmp/now.ip /var/tmp/old.ip;
    fi
  else
  # On IP read error - Log error and notify user with a distinguishable beep.
    echo "`date +%Y%m%d.%H%M%S` - `cat /var/tmp/now.ip` - not updated: read error on ip fetch" >> /var/log/ip_hist.log;
    Set_Led beep2
  fi
# You will need to Set the interval of the next check using a crontab entry.
# Once every 15 minutes is a good setting for a home server.

(:tableend:)
The log file is helpful!

Thanks guys!

Mo

July 28, 2006, at 06:53 AM by Dutch --
Changed lines 447-521 from:

Neil

to:

Neil


Based on Mo and Neil's excellent script, adds logging of changes and just one daily log entry if no change:

(:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
#!/bin/sh

USER=<dnsuser>
PASSWD=<dnspasswd>
DOMAIN=<domain.name.org>
WILDCARD=[ON|OFF]

/opt/bin/wget --quiet http://checkip.dyndns.org/ --output-document=/var/log/router_ip;

PAT='Current IP Address: *[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'

if grep -q "$PAT" /var/log/router_ip;
then
   if [ -f /var/log/router_ip_old ]
   then
      if [ "`cat /var/log/router_ip`" = "`cat /var/log/router_ip_old`" ]
      then
         find /var/log/ -name router_ip_old -mtime +28 -exec rm {} \;
         if  [ ! -f /var/log/router_ip_old ]
         then
            /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/log/upd.ip;
            cp /var/log/router_ip /var/log/router_ip_old;
            echo "`date +%Y%m%d.%H%M%S` - `cat /var/log/router_ip` - refreshed - `cat /var/log/upd.ip`" >> /var/log/ip_hist.log
            Set_Led beep1
            Set_Led beep1
            Set_Led beep1
            Set_Led beep1
            Set_Led beep1
         else
            if [ "`cat /var/log/ip_checked`" = "`date +%w`" ]
            then
               # do nothing
            else
               echo "`date +%Y%m%d.%H%M%S` - `cat /var/log/router_ip` not updated" >> /var/log/ip_hist.log
            fi
            echo "`date +%w`" > /var/log/ip_checked
         fi
      else
         /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/log/upd.ip;
         echo "`date +%Y%m%d.%H%M%S` - `cat /var/log/router_ip` - updated from `cat /var/log/router_ip_old` - `cat /var/log/upd.ip`" >> /var/log/ip_hist.log
         Set_Led beep1
         Set_Led beep1
         Set_Led beep1
         rm -f /var/log/router_ip_old;
         cp /var/log/router_ip /var/log/router_ip_old;
      fi
   else
      /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/log/upd.ip;
      echo "`date +%Y%m%d.%H%M%S` - `cat /var/log/router_ip` - initialized - `cat /var/log/upd.ip`" >> /var/log/ip_hist.log
      cp /var/log/router_ip /var/log/router_ip_old;
   fi
else
   echo "`date +%Y%m%d.%H%M%S` - `cat /var/log/router_ip` - not updated: read error on ip fetch" >> /var/log/ip_hist.log
   Set_Led beep2
fi

(:tableend:)
I figured that a log file might be helpful to assess what was happening and when....

Thanks to my log file, I was able to see roughly how long my slug was out of contact with the web when the AC power blipped and made my hub lose its mind earlier this week during a thunderstorm. (even with my UPS, it's sensitive to power blips!) It will also allow me to get rough timings of network outages on the part of my ISP, as well as info about frequency of IP changes. I also chose to have it write one log entry per day indicating that the IP was static, on the first check after midnight. Change to a different argument for the date command, and you can use a different time interval for this entry.... :^)

HTH!

Dutch

July 24, 2006, at 01:27 AM by Mo --
Changed line 317 from:

Update: 5/28/2006\\

to:

Update: 7/23/2006\\

Changed line 343 from:
            find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
to:
            /opt/bin/find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
Changed line 409 from:
            find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
to:
            /opt/bin/find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
June 30, 2006, at 12:22 AM by Mo --
Changed line 364 from:
      else echo "First time Run!";
to:
      else echo "First time run!";
Changed line 430 from:
      else echo "First time Run!";
to:
      else echo "First time run!";
June 29, 2006, at 11:54 PM by Mo --
Changed line 345 from:
              then echo "It has been 28 Days with no IP Address Change!!";
to:
              then echo "It has been 28 Days with no IP Address Change!";
Changed line 348 from:
                echo "Recording my IP Address..";
to:
                echo "Recording my IP Address...";
Changed line 355 from:
          else echo "I have a new IP Address!!";
to:
          else echo "I have a new IP Address!";
Changed line 359 from:
            echo "Recording my new IP Address..";
to:
            echo "Recording my new IP Address...";
Changed line 367 from:
        echo "Recording my current IP Address..";
to:
        echo "Recording my current IP Address...";
Changed line 411 from:
              then echo "It has been 28 Days with no IP Address Change!!";
to:
              then echo "It has been 28 Days with no IP Address Change!";
Changed line 414 from:
                echo "Recording my IP Address..";
to:
                echo "Recording my IP Address...";
Changed line 421 from:
          else echo "I have a new IP Address!!";
to:
          else echo "I have a new IP Address!";
Changed line 425 from:
            echo "Recording my new IP Address..";
to:
            echo "Recording my new IP Address...";
Changed line 433 from:
        echo "Recording my current IP Address..";
to:
        echo "Recording my current IP Address...";
June 28, 2006, at 03:01 AM by Mo --
Changed line 350 from:
              else echo "Your DynDNS Account is in good standing";
to:
              else echo "Your DynDNS Account is in good standing.";
Changed line 416 from:
              else echo "Your DynDNS Account is in good standing";
to:
              else echo "Your DynDNS Account is in good standing.";
June 28, 2006, at 02:23 AM by Mo --
Changed line 413 from:
                /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update? hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
to:
                /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
Changed line 423 from:
            /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?host name=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
to:
            /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
Changed line 432 from:
        /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname =${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
to:
        /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
June 20, 2006, at 06:48 PM by neilblue -- with added vars :)
Changed lines 383-447 from:

to:

Thanks Mo, here it is again with added common variables and a wildcard flag:

(:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
#!/bin/ash

USER=<dnsuser>
PASSWD=<dnspasswd>
DOMAIN=<domain.name.org>
WILDCARD=[ON|OFF]

echo "Checking my current IP Address...";
/opt/bin/wget --quiet http://checkip.dyndns.org/ --output-document=/var/tmp/now.ip;
echo "Verifying received data...";
PAT='Current IP Address: *[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'
  if grep -q "$PAT" /var/tmp/now.ip;
  then echo "Current IP Address verified.";
    echo "Looking for IP Address history...";
      if [ -f /var/tmp/old.ip ]
      then echo "History Found.";
        echo "Comparing IP Address history with the present...";
          if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ]
          then echo "I still have the same IP Address.";
            echo "Checking the status of your DynDNS Account...";
            find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
              if  [ ! -f /var/tmp/old.ip ]
              then echo "It has been 28 Days with no IP Address Change!!";
                echo "Refreshing your DynDNS Account...";
                /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update? hostname=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
                echo "Recording my IP Address..";
                cp /var/tmp/now.ip /var/tmp/old.ip;
              else echo "Your DynDNS Account is in good standing";
              fi
            echo "My IP Address matches DynDNS's records.";
            cat /var/tmp/upd.ip;
            echo " is my IP Address.";
          else echo "I have a new IP Address!!";
            echo "Updating DynDNS with my new IP Address...";
            /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?host name=${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
            rm -f /var/tmp/old.ip;
            echo "Recording my new IP Address..";
            cp /var/tmp/now.ip /var/tmp/old.ip;
            cat /var/tmp/upd.ip;
            echo " is my new IP Address.";
          fi
      else echo "First time Run!";
        echo "Setting up DynDNS with my current IP Address...";
        /opt/bin/wget --quiet "http://${USER}:${PASSWD}@members.dyndns.org/nic/update?hostname =${DOMAIN}&wildcard=${WILDCARD}" --output-document=/var/tmp/upd.ip;
        echo "Recording my current IP Address..";
        cp /var/tmp/now.ip /var/tmp/old.ip;
        cat /var/tmp/upd.ip;
        echo " is my current IP Address.";
      fi
  else echo "Something is wrong!";
    echo "I could not obtain the correct information from the DynDNS Service.";
    echo "Check your network connections.";
  fi
echo "I will check my IP Address again in 15 minutes."

(:tableend:)
Neil

May 29, 2006, at 03:27 AM by Mo --
Added line 326:
May 29, 2006, at 03:22 AM by Mo --
Changed line 346 from:
                /opt/bin/wget --quiet http://Rofick:WM6WtlUI@members.dyndns.org/nic/update?hostname=rofick.selfip.com --output-document=/var/tmp/upd.ip;
to:
                /opt/bin/wget --quiet http://user:pass@members.dyndns.org/nic/update?hostname=user.selfip.com --output-document=/var/tmp/upd.ip;
Changed line 356 from:
            /opt/bin/wget --quiet http://Rofick:WM6WtlUI@members.dyndns.org/nic/update?hostname=rofick.selfip.com --output-document=/var/tmp/upd.ip;
to:
            /opt/bin/wget --quiet http://user:pass@members.dyndns.org/nic/update?hostname=user.selfip.com --output-document=/var/tmp/upd.ip;
Changed line 365 from:
        /opt/bin/wget --quiet http://Rofick:WM6WtlUI@members.dyndns.org/nic/update?hostname=rofick.selfip.com --output-document=/var/tmp/upd.ip;
to:
        /opt/bin/wget --quiet http://user:pass@members.dyndns.org/nic/update?hostname=user.selfip.com --output-document=/var/tmp/upd.ip;
May 29, 2006, at 03:19 AM by Mo --
Changed lines 317-321 from:

Update: 5/25/2006
Try this script! It replaces dnsupd found at the beginning of this article. It works great with
uNSLUng 6.8 and wget-ssl. Uses slick file find and logic to refresh the DynDNS Account if there is
no IP Address change for 28 days. Works well even if the slug was off for a while.
Echo commands are in there so you can see how it works, but you can remove them.\\

to:

Update: 5/28/2006
Try this script! It replaces dnsupd found at the beginning of this article, and
it incorporates some of the good ideas posted here.
It works great with uNSLUng 6.8 and wget-ssl.
Uses slick file find and logic to refresh the DynDNS Account if there is
no IP Address change for 28 days. Works well even if the slug was off
for a while. Echo commands are in there so you can see how it works,
but you can remove them.\\

Deleted line 325:
Changed lines 329-362 from:

echo "Checking my current IP Address..." /opt/bin/wget --quiet http://checkip.dyndns.org/index.html --output-document=/var/tmp/now.ip; if [ -f /var/tmp/old.ip ] then if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ] then echo "I still have the same IP Address." find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \; if [ ! -f /var/tmp/old.ip ] then echo "It has been 28 Days with no IP Address Change!!"; echo "It is Time to Force DynDNS to Update your Account."; echo "Updating your DynDNS Account Lease..."; /opt/bin/wget --quiet http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip; echo "Recording my IP Address.."; cp /var/tmp/now.ip /var/tmp/old.ip; fi echo "My IP Address matches DynDNS's records."; cat /var/tmp/upd.ip; echo " is my IP Address."; else echo "I have a new IP Address!!"; echo "Updating DynDNS with my new IP Address..."; /opt/bin/wget --quiet http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip; rm -f /var/tmp/old.ip; echo "Recording my new IP Address.."; cp /var/tmp/now.ip /var/tmp/old.ip; cat /var/tmp/upd.ip; echo " is my new IP Address."; fi else echo "First time Run!"; echo "Updating DynDNS with my current IP Address..."; /opt/bin/wget --quiet http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip; echo "Recording my current IP Address.."; cp /var/tmp/now.ip /var/tmp/old.ip; cat /var/tmp/upd.ip; echo " is my current IP Address."; fi

to:

echo "Checking my current IP Address..."; /opt/bin/wget --quiet http://checkip.dyndns.org/ --output-document=/var/tmp/now.ip; echo "Verifying received data..."; PAT='Current IP Address: *[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'

  if grep -q "$PAT" /var/tmp/now.ip;
  then echo "Current IP Address verified.";
    echo "Looking for IP Address history...";
      if [ -f /var/tmp/old.ip ]
      then echo "History Found.";
        echo "Comparing IP Address history with the present...";
          if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ]
          then echo "I still have the same IP Address.";
            echo "Checking the status of your DynDNS Account...";
            find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
              if  [ ! -f /var/tmp/old.ip ]
              then echo "It has been 28 Days with no IP Address Change!!";
                echo "Refreshing your DynDNS Account...";
                /opt/bin/wget --quiet http://Rofick:WM6WtlUI@members.dyndns.org/nic/update?hostname=rofick.selfip.com --output-document=/var/tmp/upd.ip;
                echo "Recording my IP Address..";
                cp /var/tmp/now.ip /var/tmp/old.ip;
              else echo "Your DynDNS Account is in good standing";
              fi
            echo "My IP Address matches DynDNS's records.";
            cat /var/tmp/upd.ip;
            echo " is my IP Address.";
          else echo "I have a new IP Address!!";
            echo "Updating DynDNS with my new IP Address...";
            /opt/bin/wget --quiet http://Rofick:WM6WtlUI@members.dyndns.org/nic/update?hostname=rofick.selfip.com --output-document=/var/tmp/upd.ip;
            rm -f /var/tmp/old.ip;
            echo "Recording my new IP Address..";
            cp /var/tmp/now.ip /var/tmp/old.ip;
            cat /var/tmp/upd.ip;
            echo " is my new IP Address.";
          fi
      else echo "First time Run!";
        echo "Setting up DynDNS with my current IP Address...";
        /opt/bin/wget --quiet http://Rofick:WM6WtlUI@members.dyndns.org/nic/update?hostname=rofick.selfip.com --output-document=/var/tmp/upd.ip;
        echo "Recording my current IP Address..";
        cp /var/tmp/now.ip /var/tmp/old.ip;
        cat /var/tmp/upd.ip;
        echo " is my current IP Address.";
      fi
  else echo "Something is wrong!";
    echo "I could not obtain the correct information from the DynDNS Service.";
    echo "Check your network connections.";
  fi
May 25, 2006, at 11:10 PM by Mo --
Changed lines 318-323 from:

Try this script! It replaces dnsupd found at the beginning of this article
It works great with uNSLUng 6.8 and wget-ssl.
Uses slick file find and logic to refresh the DynDNS Account if there is
no IP Address change for 28 days. Works well even if the slug was off
for a while. Echo commands are in there so you can see how it works,
but you can remove them.\\

to:

Try this script! It replaces dnsupd found at the beginning of this article. It works great with
uNSLUng 6.8 and wget-ssl. Uses slick file find and logic to refresh the DynDNS Account if there is
no IP Address change for 28 days. Works well even if the slug was off for a while.
Echo commands are in there so you can see how it works, but you can remove them.\\

Added line 323:
May 25, 2006, at 11:06 PM by Mo --
Changed line 317 from:

Update: 5/25/2006

to:

Update: 5/25/2006\\

Changed lines 319-324 from:

It works great with uNSLUng 6.8 and wget-ssl.
Uses slick file find and logic to refresh the DynDNS Account if there is

no IP Address change for 28 days. Works well even if the slug was off
for a while. Echo commands are in there so you can see how it works,
but you can remove them.

to:

It works great with uNSLUng 6.8 and wget-ssl.
Uses slick file find and logic to refresh the DynDNS Account if there is
no IP Address change for 28 days. Works well even if the slug was off
for a while. Echo commands are in there so you can see how it works,
but you can remove them.
\\

May 25, 2006, at 11:02 PM by Mo --
Changed lines 317-323 from:

Try this script! Replaces the one at the beginning of this article.
It works great with uNSLUng 6.8 and wget-ssl.
Works correctly! Even if the slug is off for a while.
Uses slick file manipulation and logic to refresh DynDNS Account every 28 days if no IP Address change.

to:

Update: 5/25/2006 Try this script! It replaces dnsupd found at the beginning of this article
It works great with uNSLUng 6.8 and wget-ssl.
Uses slick file find and logic to refresh the DynDNS Account if there is

no IP Address change for 28 days. Works well even if the slug was off
for a while. Echo commands are in there so you can see how it works,
but you can remove them.

Changed lines 327-362 from:
 #!/bin/ash
 echo "Checking my current IP Address..."
 /opt/bin/wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/now.ip;
 if [ -f /var/tmp/old.ip ]
 then if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ]
 then echo "I still have the same IP Address."
 find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
 if  [ ! -f /var/tmp/old.ip ]
 then echo "It has been 28 Days with no IP Address Change!!";
 echo "It is Time to Force DynDNS to Update your Account.";
 echo "Updating your DynDNS Account Lease...";
 /opt/bin/wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip;
 echo "Recording my IP Address..";
 cp /var/tmp/now.ip /var/tmp/old.ip;
 fi
 echo "My IP Address matches DynDNS's records.";
 cat /var/tmp/upd.ip;
 echo " is my IP Address.";
 else echo "I have a new IP Address!!";
 echo "Updating DynDNS with my new IP Address...";
 /opt/bin/wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip;
 rm -f /var/tmp/old.ip;
 echo "Recording my new IP Address..";
 cp /var/tmp/now.ip /var/tmp/old.ip;
 cat /var/tmp/upd.ip;
 echo " is my new IP Address.";
 fi
 else echo "First time Run!";
 echo "Updating DynDNS with my current IP Address...";
 /opt/bin/wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip;
 echo "Recording my current IP Address..";
 cp /var/tmp/now.ip /var/tmp/old.ip;
 cat /var/tmp/upd.ip;
 echo " is my current IP Address.";
 fi
 echo "I will check my IP Address again in 15 minutes."
to:
  1. !/bin/ash

echo "Checking my current IP Address..." /opt/bin/wget --quiet http://checkip.dyndns.org/index.html --output-document=/var/tmp/now.ip; if [ -f /var/tmp/old.ip ] then if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ] then echo "I still have the same IP Address." find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \; if [ ! -f /var/tmp/old.ip ] then echo "It has been 28 Days with no IP Address Change!!"; echo "It is Time to Force DynDNS to Update your Account."; echo "Updating your DynDNS Account Lease..."; /opt/bin/wget --quiet http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip; echo "Recording my IP Address.."; cp /var/tmp/now.ip /var/tmp/old.ip; fi echo "My IP Address matches DynDNS's records."; cat /var/tmp/upd.ip; echo " is my IP Address."; else echo "I have a new IP Address!!"; echo "Updating DynDNS with my new IP Address..."; /opt/bin/wget --quiet http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip; rm -f /var/tmp/old.ip; echo "Recording my new IP Address.."; cp /var/tmp/now.ip /var/tmp/old.ip; cat /var/tmp/upd.ip; echo " is my new IP Address."; fi else echo "First time Run!"; echo "Updating DynDNS with my current IP Address..."; /opt/bin/wget --quiet http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip; echo "Recording my current IP Address.."; cp /var/tmp/now.ip /var/tmp/old.ip; cat /var/tmp/upd.ip; echo " is my current IP Address."; fi echo "I will check my IP Address again in 15 minutes."

Changed line 368 from:

Mo

to:

Mo

May 25, 2006, at 12:43 AM by Mo --
Changed lines 321-323 from:

Uses slick file manipulation and logic to refresh DynDNS Account every 28 days.

to:

Uses slick file manipulation and logic to refresh DynDNS Account every 28 days if no IP Address change.

May 25, 2006, at 12:40 AM by Mo --
Changed lines 318-322 from:

Try this script! Replaces the one at the beginning of this article. It works great with uNSLUng 6.8 and wget-ssl. Works correctly! Even if the slug is off for a while.

to:

Try this script! Replaces the one at the beginning of this article.
It works great with uNSLUng 6.8 and wget-ssl.
Works correctly! Even if the slug is off for a while.
Uses slick file manipulation and logic to refresh DynDNS Account every 28 days.

May 25, 2006, at 12:30 AM by Mo --
Changed lines 318-319 from:

Try this script! It works great with uNSLUng 6.8.

to:

Try this script! Replaces the one at the beginning of this article. It works great with uNSLUng 6.8 and wget-ssl. Works correctly! Even if the slug is off for a while.

Added lines 364-367:

Enjoy!

Mo


May 25, 2006, at 12:15 AM by Mo --
Changed line 323 from:
 echo "Cheching my current IP Address..."
to:
 echo "Checking my current IP Address..."
May 24, 2006, at 10:23 PM by Mo --
Changed lines 314-360 from:

*/15 every 15 minutes

to:

*/15 every 15 minutes


Try this script! It works great with uNSLUng 6.8.

(:table border=0 width=100% bgcolor=#eeeeff:)

(:cell:)
 #!/bin/ash
 echo "Cheching my current IP Address..."
 /opt/bin/wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/now.ip;
 if [ -f /var/tmp/old.ip ]
 then if [ "`cat /var/tmp/now.ip`" = "`cat /var/tmp/old.ip`" ]
 then echo "I still have the same IP Address."
 find /var/tmp/ -name old.ip -mtime +28 -exec rm {} \;
 if  [ ! -f /var/tmp/old.ip ]
 then echo "It has been 28 Days with no IP Address Change!!";
 echo "It is Time to Force DynDNS to Update your Account.";
 echo "Updating your DynDNS Account Lease...";
 /opt/bin/wget -q http://''username'':''password''@members.dyndns.org/nic/update?hostname=''domainname''.dyndns.org --output-document=/var/tmp/upd.ip;
 echo "Recording my IP Address..";
 cp /var/tmp/now.ip /var/tmp/old.ip;
 fi
 echo "My IP Address matches DynDNS's records.";
 cat /var/tmp/upd.ip;
 echo " is my IP Address.";
 else echo "I have a new IP Address!!";
 echo "Updating DynDNS with my new IP Address...";
 /opt/bin/wget -q http://''username'':''password''@members.dyndns.org/nic/update?hostname=''domainname''.dyndns.org --output-document=/var/tmp/upd.ip;
 rm -f /var/tmp/old.ip;
 echo "Recording my new IP Address..";
 cp /var/tmp/now.ip /var/tmp/old.ip;
 cat /var/tmp/upd.ip;
 echo " is my new IP Address.";
 fi
 else echo "First time Run!";
 echo "Updating DynDNS with my current IP Address...";
 /opt/bin/wget -q http://''username'':''password''@members.dyndns.org/nic/update?hostname=''domainname''.dyndns.org --output-document=/var/tmp/upd.ip;
 echo "Recording my current IP Address..";
 cp /var/tmp/now.ip /var/tmp/old.ip;
 cat /var/tmp/upd.ip;
 echo " is my current IP Address.";
 fi
 echo "I will check my IP Address again in 15 minutes."

(:tableend:) \\

March 10, 2006, at 02:56 PM by Thomas Wagner --
Changed lines 314-315 from:

*/15 every 15 minutes \\

to:

*/15 every 15 minutes

March 10, 2006, at 02:55 PM by Thomas Wagner --
Changed lines 314-315 from:

*/15 ervery 15 minutes\\

to:

*/15 every 15 minutes \\

March 10, 2006, at 02:54 PM by Thomas Wagner --
Changed lines 312-314 from:

from the crontab man page: "Steps are also permitted after an asterisk, so if you want to say ``every two hours, just use ``*/2."

  • /15 ervery 15 minutes
to:

from the crontab man page:
"Steps are also permitted after an asterisk, so if you want to say ``every two hours, just use ``*/2."
*/15 ervery 15 minutes\\

March 10, 2006, at 02:51 PM by Thomas Wagner --
Added lines 309-314:

from the crontab man page: "Steps are also permitted after an asterisk, so if you want to say ``every two hours, just use ``*/2."

  • /15 ervery 15 minutes
March 07, 2006, at 09:57 PM by EtH --
Added lines 306-308:

Don't work on Unslug 5.5 if oldip don't reply to ping! :(

March 06, 2006, at 08:46 PM by SPoner --
Changed line 305 from:

SPoner March 06, 2006, at 05:31 PM

to:

SPoner March 06, 2006, at 05:31 PM

March 06, 2006, at 08:45 PM by spike80 --
Changed lines 289-290 from:

newip=`wget -q -O - http://checkip.dyndns.org/index.html | tr "<" " " | tr ">" " " | sed 's/\(^.* \)\([0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}\)\(.*\)/\2/g`

to:

newip=`wget -q -O - http://checkip.dyndns.org/index.html | tr "<" " " | tr ">" " " | sed 's/\(^.* \)\([0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}\)\(.*\)/\2/g'`

March 06, 2006, at 05:42 PM by SPoner --
Changed line 276 from:

Here is my dirty solution, without using any file an "disc".

to:

This is my litle dirty solution. A read-only-methode.

Changed lines 279-281 from:

Use is it or delete it.

to:
March 06, 2006, at 05:31 PM by SPoner --
Added lines 271-307:

Here is my dirty solution, without using any file an "disc". (testet on openslug 2.7)

Use is it or delete it.

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
#!/bin/sh
domain=example.dnydns.org
user=username
pass=password

oldip=`ping -c 1 $domain | grep "PING" | tr -d "(" | tr -d ")" | sed 's/\(^.* \)\([0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}\)\(.*\)/\2/g'`
newip=`wget -q -O - http://checkip.dyndns.org/index.html | tr "<" " " | tr ">" " " | sed 's/\(^.* \)\([0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}\)\(.*\)/\2/g`

if [ $oldip = $newip ]; then 
	echo "No new IP ($newip)";
	exit 0
else
	echo "Old IP ($oldip) - New IP ($newip)";
	result=`wget -q http://$user:$pass@members.dyndns.org/nic/update?hostname=$domain -q -O -`
	echo $result;
	echo $result | grep -q "good"
	if [ $result -ne 0 ]; then exit 1; fi
	exit 0
fi

(:tableend:)

SPoner March 06, 2006, at 05:31 PM

February 25, 2006, at 12:10 PM by dustinemptyspace --
Changed line 15 from:

(:cell:)[=

to:

(:cell:)[@

Changed line 27 from:

=]

to:

@]

February 04, 2006, at 04:46 PM by John Bates -- More Cautious Update
Changed lines 15-16 from:

(:cell:)

 [=
to:

(:cell:)[=

Changed lines 239-270 from:

Nov 24th 2005

to:

Nov 24th 2005


The above scripts could trigger an update if, for any reason, the initial wget of checkip.dyndns.org failed. So it probably doesn't do any harm to surround the update with a check to ensure that the files containing the old.ip and new.ip look as though they contain valid data. My update script looks like this:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
 #!/bin/sh
 wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
 then
        echo "No new IP"
 else
        PAT='Current IP Address:.*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'
        if grep -q "$PAT" /var/tmp/new.ip && grep -q "$PAT" /var/tmp/old.ip; then
                wget -q 'http://MYNAME:MYPASSWORD@members.dyndns.org/nic/update?system=custom&hostname=MYHOST.MYDOMAIN.co.uk' -O /var/tmp/upd.ip
                echo "New IP"
                mv /var/tmp/new.ip /var/tmp/old.ip
                rm -f /var/tmp/upd.ip
        fi
 fi

(:tableend:)

The two greps ensure that the files contain the expected pattern before trusting their content.

John Bates - 4th Feb 2006

February 04, 2006, at 04:28 PM by John Bates --
Changed line 240 from:

Nov 24th 2005 (did I break the page...... what happened?)

to:

Nov 24th 2005

November 24, 2005, at 12:55 PM by Asko Kauppi --
Changed line 240 from:

Nov 24th 2005

to:

Nov 24th 2005 (did I break the page...... what happened?)

November 24, 2005, at 12:53 PM by Asko Kauppi -- A simpler suggestion for refresh issue.
Changed lines 225-240 from:

June 13, 2005

to:

June 13, 2005


Now, why couldn't the 28-day refreshment be made simply by a second "forced" crontab entry, like:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:) 59 23 14,28 * * root /opt/bin/dnsupd-force &> /dev/null (:tableend:)

Sure, that would run on 14th and 28th, is that too often?

Also, what's the purpose of "*/15" in the beginning of original crontab line, why not just "15".

Asko Kauppi Nov 24th 2005

July 17, 2005, at 01:07 AM by Andrei Volkov --
Changed lines 208-209 from:
   else wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com\&wildcard=NOCHG --output-document=/var/tmp/upd.ip  echo "New IP:";
to:
   else wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com\&wildcard=NOCHG --output-document=/var/tmp/upd.ip
  echo "New IP:";
June 14, 2005, at 06:18 PM by Andrei Volkov --
Changed line 196 from:
   wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com --output-document=/var/tmp/upd.ip
to:
   wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com\&wildcard=NOCHG --output-document=/var/tmp/upd.ip
Changed line 208 from:
   else wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com --output-document=/var/tmp/upd.ip  echo "New IP:";
to:
   else wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com\&wildcard=NOCHG --output-document=/var/tmp/upd.ip  echo "New IP:";
June 14, 2005, at 06:10 PM by Andrei Volkov --
Changed lines 174-175 from:

The copied-pasted 28-day complete solution script above didn't work for me on Unslung 4 beta. It gave error "EOF: back quote parsing error" and complained about --time-style being invalid option for ls. I changed the output of date command to match output of ls. Here are modifications to matrix69's script that made it work:

to:

The copied-pasted 28-day complete solution script above didn't work for me on Unslung 4 beta, perhaps because of plain old vanilla non-upgraded ls built-into BusyBox? v0.60.4. It gave error "EOF: back quote parsing error" and complained about --time-style option being invalid option for ls. I changed the output of date command to match output of ls. Also, matrix69's script will update IP only once every 28 days, as opposed to

 1) Checking IP (once an hour or so) and updating IP if it changes

and

 2) Updating IP every 28 days even if IP has not changed yet


Here is modified script that does the above and works with limited ls from BusyBox? that comes with Unslung 4 beta binary.
Of course, the script needs to be scheduled to run on regular intervals in crontab to fulfill its purposes. DynDNS website does not allow/recommend checking IP with them more often than every 10 minutes.

Changed lines 189-192 from:

............

 if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days /var/tmp/exp.ip; fi
 if [ "`ls -l /var/tmp/exp.ip |cut -b44-49`" = "`date --date="-28 days" +'%b %e'`" ]

............

to:
 #!/bin/ash

if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days /var/tmp/exp.ip; fi

if [ "`ls -l /var/tmp/exp.ip |cut -b44-49`" = "`date --date="-28 days" +'e'`" ] then

   wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com --output-document=/var/tmp/upd.ip
   echo "28-th day - Mandatory update. Refreshed IP:";
   cat /var/tmp/upd.ip; 
   rm /var/tmp/upd.ip;  
   rm -f /var/tmp/old.ip
   mv /var/tmp/new.ip /var/tmp/old.ip
   touch /var/tmp/exp.ip 

else

  echo "Checking IP ..."
  wget -q http://checkip.dyndns.org:8245/index.html --output-document=/var/tmp/new.ip
   if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]; then
     echo "No new IP";
   else wget -q http://user:password@members.dyndns.org:8245/nic/update?hostname=www.yourdomain.com --output-document=/var/tmp/upd.ip  echo "New IP:";
     cat /var/tmp/upd.ip; 
     rm /var/tmp/upd.ip; 
   fi 
   rm -f /var/tmp/old.ip
   mv /var/tmp/new.ip /var/tmp/old.ip
   touch /var/tmp/exp.ip 

fi

Added line 218:

\\

June 13, 2005, at 10:20 PM by Andrei Volkov --
Changed line 180 from:
 if [ "`ls -l /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'%b %e'`" ]
to:
 if [ "`ls -l /var/tmp/exp.ip |cut -b44-49`" = "`date --date="-28 days" +'%b %e'`" ]
Changed line 186 from:
to:

\\

June 13, 2005, at 10:18 PM by Andrei Volkov --
Changed lines 171-189 from:

14 Apr 2005

to:

14 Apr 2005


The copied-pasted 28-day complete solution script above didn't work for me on Unslung 4 beta. It gave error "EOF: back quote parsing error" and complained about --time-style being invalid option for ls. I changed the output of date command to match output of ls. Here are modifications to matrix69's script that made it work:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:) ............

 if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days /var/tmp/exp.ip; fi
 if [ "`ls -l /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'%b %e'`" ]

............ (:tableend:)

It is important to note that this script will work ONLY if NSLU2 is up and running on the 28-th day so it can detect the condition when current date is equal to current date minus 28 days.
Andrei Volkov

June 13, 2005

April 17, 2005, at 08:58 AM by RobHam --
Changed lines 5-6 from:

nb if you have already upgraded BusyBox? then the above might fail- see HowTo.InstallWgetAfterUpgradingBusyBox

to:

nb if you have already upgraded BusyBox then the above might fail- see HowTo.InstallWgetAfterUpgradingBusyBox

Changed lines 13-16 from:

\\

to:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 [=
Added lines 28-29:

=] (:tableend:)

Added lines 44-47:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 [=
Added lines 54-55:

=] (:tableend:)

Changed line 68 from:

''For your information i use the build UNSLUNG-1.11-beta-V23R25?.bin\\

to:

''For your information i use the build UNSLUNG-1.11-beta-V23R25.bin\\

Changed lines 78-81 from:

http://USERNAME:PASSWORD@members.dyndns.org/nic/update?system=custom&hostname=DOMAINNAME.COM

Just change USERNAME, PASSWORD, and DOMAINNAME.COM for it to work.

to:

http://USERNAME:PASSWORD@members.dyndns.org/nic/update?system=custom&hostname=DOMAINNAME.COM

Just change USERNAME, PASSWORD, and DOMAINNAME.COM for it to work.

Added lines 88-90:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 [=
Changed lines 106-107 from:
to:

=] (:tableend:)

Changed lines 114-117 from:

If you use DynDNS wildcards, you should include \&wildcard=NOCHG in the update line.

This script still doesn't meet the requirements. One must send an update after 28 days even if the ip address hasn't changed. DynDNS will disable your account for abuse if you update too often, and for inactivity if you're lucky enough to have a stable IP address for 30 days. They allow a refresh at 28 days.

to:

If you use DynDNS wildcards, you should include \&wildcard=NOCHG in the update line.

This script still doesn't meet the requirements. One must send an update after 28 days even if the ip address hasn't changed. DynDNS will disable your account for abuse if you update too often, and for inactivity if you're lucky enough to have a stable IP address for 30 days. They allow a refresh at 28 days.

Added lines 131-133:

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

Added lines 149-150:

(:tableend:)

Changed line 161 from:

RobHam? has recommended the use of port 8245

to:

RobHam has recommended the use of port 8245

Changed lines 164-167 from:

http://checkip.dyndns.org:8245/index.html

http//<login>:<password>@members.dyndns.org:8245/nic/update?hostname=<yourDynHostName>

to:

http://checkip.dyndns.org:8245/index.html

http//<login>:<password>@members.dyndns.org:8245/nic/update?hostname=<yourDynHostName>

April 14, 2005, at 09:06 PM by RobHam --
Changed lines 137-139 from:

If your NSLU2 is behind a transparent proxy, http://checkip.dyndns.org and http://members.dyndns.org may return/updates with your proxy server's IP address instead of your NSLU2's.

Robert Hammond has recommended the use of port 8245

to:

If your NSLU2 is behind a transparent proxy, http://checkip.dyndns.org and http://members.dyndns.org may return/update with your proxy server's IP address instead of your NSLU2's.

Added line 141:

RobHam? has recommended the use of port 8245

April 14, 2005, at 01:45 AM by Ming Kiat --
Changed lines 135-150 from:

--matrix69

to:

--matrix69


If your NSLU2 is behind a transparent proxy, http://checkip.dyndns.org and http://members.dyndns.org may return/updates with your proxy server's IP address instead of your NSLU2's.

Robert Hammond has recommended the use of port 8245

so I have updated my scripts to use

http://checkip.dyndns.org:8245/index.html

http//<login>:<password>@members.dyndns.org:8245/nic/update?hostname=<yourDynHostName>

and I always get the right IP.

Ming Kiat 14 Apr 2005

April 01, 2005, at 03:45 AM by matrix69 --
Changed line 118 from:
 if [ "`ls -l --time-style=+m-%d /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'d'`" ]
to:
 if [ "`ls -l --time-style=+%Y-%m-%d /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'%m-%d'`" ]
April 01, 2005, at 03:42 AM by matrix69 --
Changed line 113 from:

Below a complet solution to run only after 28 days:

to:

Find a complette solution below, to run only every 28 days:

Changed lines 132-133 from:

NOTE: need to modify the /etc/crontab entry,to run just on time by day, use less CPU :-) 5 17 * * * root /opt/bin/dnsupd &> /dev/null

to:

NOTE: for less use of CPU, modify the /etc/crontab entry,to run just once per day :-) 5 17 * * * root /opt/bin/dnsupd &> /dev/null\\

April 01, 2005, at 03:35 AM by matrix69 --
Changed lines 3-4 from:

Install wget:
ipkg install wget\\

to:

Install wget: ipkg install wget

Changed lines 8-9 from:

if not exists /var/tmp create it:
mkdir /var/tmp\\

to:

if not exists /var/tmp create it: mkdir /var/tmp

Changed lines 11-12 from:

Add dnsupd script:
vi /opt/bin/dnsupd\\

to:

Add dnsupd script: vi /opt/bin/dnsupd

Changed lines 14-16 from:
 #!/bin/ash
wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]\\
to:
 #!/bin/ash
 wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
Changed lines 18-24 from:
 else wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip
echo "New IP";
cat /var/tmp/upd.ip;
rm /var/tmp/upd.ip;
fi
rm -f /var/tmp/old.ip
mv /var/tmp/new.ip /var/tmp/old.ip@@\\
to:
 else wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip
 echo "New IP";
 cat /var/tmp/upd.ip;
 rm /var/tmp/upd.ip;
 fi
 rm -f /var/tmp/old.ip
 mv /var/tmp/new.ip /var/tmp/old.ip
Changed lines 29-32 from:

domainname = your registered domainname (i.e. whatever.dyndns.org)''\\

to:

domainname = your registered domainname (i.e. whatever.dyndns.org)''
make dnsupd executable: chmod 755 /opt/bin/dnsupd

Deleted lines 33-34:

make dnsupd executable:
chmod 755 /opt/bin/dnsupd\\

Deleted lines 34-38:
Changed line 37 from:

vi /opt/etc/init.d/S60dnsupd\\

to:

vi /opt/etc/init.d/S60dnsupd

Changed lines 39-44 from:

#!/bin/sh
if [ -n "`pidof dnsupd`" ]; then
/bin/killall dnsupd 2>/dev/null
fi
umask 077
/opt/bin/dnsupd
\\

to:
 #!/bin/sh
 if [ -n "`pidof dnsupd`" ]; then
    /bin/killall dnsupd 2>/dev/null
 fi
 umask 077
 /opt/bin/dnsupd
Changed line 121 from:
 else wget -q http://username:password@members.dyndns.org/nic/update?hostname=yourname.dyndns.org --output-document=/var/tmp/upd.ip\\
to:
 else wget -q http://username:password@members.dyndns.org/nic/update?hostname=yourname.dyndns.org --output-document=/var/tmp/upd.ip\\
April 01, 2005, at 03:28 AM by matrix69 --
Changed lines 14-24 from:

#!/bin/ash
wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
then echo "No new IP";
else wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip
echo "New IP";
cat /var/tmp/upd.ip;
rm /var/tmp/upd.ip;
fi
rm -f /var/tmp/old.ip
mv /var/tmp/new.ip /var/tmp/old.ip
\\

to:
 #!/bin/ash
wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
then echo "No new IP"; else wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip
echo "New IP";
cat /var/tmp/upd.ip;
rm /var/tmp/upd.ip;
fi
rm -f /var/tmp/old.ip
mv /var/tmp/new.ip /var/tmp/old.ip@@\\
Added lines 34-38:
Changed lines 117-118 from:

Below a complet solution to run only after 28 days:
- tested on unslung V2.3R25-uNSLUng-standard-3.18-beta 2005-04-01 -\\

to:

Below a complet solution to run only after 28 days: - tested on unslung V2.3R25-uNSLUng-standard-3.18-beta - 2005-04-01 -

Changed lines 120-134 from:
  1. !/bin/ash
    if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days` /var/tmp/exp.ip; fi
    if [ "`ls -l --time-style=+m-%d /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'d'`" ]
    then wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
    if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]; then echo "No new IP";\\

else wget -q http://username:password@members.dyndns.org/nic/update?hostname=yourname.dyndns.org --output-document=/var/tmp/upd.ip
echo "New IP";
cat /var/tmp/upd.ip;\\ rm /var/tmp/upd.ip;\\ fi\\ rm -f /var/tmp/old.ip\\ mv /var/tmp/new.ip /var/tmp/old.ip
touch /var/tmp/exp.ip\\ else echo "Skipped"
fi\\

to:
 #!/bin/ash
 if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days` /var/tmp/exp.ip; fi
 if [ "`ls -l --time-style=+m-%d /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'d'`" ]
 then wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]; then echo "No new IP";
 else wget -q http://username:password@members.dyndns.org/nic/update?hostname=yourname.dyndns.org --output-document=/var/tmp/upd.ip
echo "New IP"; cat /var/tmp/upd.ip; rm /var/tmp/upd.ip; fi rm -f /var/tmp/old.ip mv /var/tmp/new.ip /var/tmp/old.ip touch /var/tmp/exp.ip else echo "Skipped" fi
Changed lines 136-138 from:

NOTE: need to modify the /etc/crontab entry,
to run just on time by day, use less CPU :-)
5 17 * * * root /opt/bin/dnsupd &> /dev/null\\

to:

NOTE: need to modify the /etc/crontab entry,to run just on time by day, use less CPU :-) 5 17 * * * root /opt/bin/dnsupd &> /dev/null

April 01, 2005, at 03:14 AM by matrix69 --
Changed lines 108-135 from:

--tlhackque

to:

--tlhackque



Below a complet solution to run only after 28 days:
- tested on unslung V2.3R25-uNSLUng-standard-3.18-beta 2005-04-01 -

#!/bin/ash
if [ ! -e /var/tmp/exp.ip ]; then touch -d -28days` /var/tmp/exp.ip; fi
if [ "`ls -l --time-style=+m-%d /var/tmp/exp.ip |cut -b32-36`" = "`date --date="-28 days" +'d'`" ]
then wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]; then echo "No new IP";\\
else wget -q http://username:password@members.dyndns.org/nic/update?hostname=yourname.dyndns.org --output-document=/var/tmp/upd.ip
echo "New IP";
cat /var/tmp/upd.ip;\\ rm /var/tmp/upd.ip;\\ fi\\ rm -f /var/tmp/old.ip\\ mv /var/tmp/new.ip /var/tmp/old.ip
touch /var/tmp/exp.ip\\ else echo "Skipped"
fi

NOTE: need to modify the /etc/crontab entry,
to run just on time by day, use less CPU :-)
5 17 * * * root /opt/bin/dnsupd &> /dev/null

--matrix69

March 04, 2005, at 08:18 PM by bobtm --
Changed line 23 from:

rm /var/tmp/old.ip\\

to:

rm -f /var/tmp/old.ip\\

Changed line 88 from:
 rm /var/tmp/old.ip
to:
 rm -f /var/tmp/old.ip
January 16, 2005, at 10:12 PM by bobtm --
Changed lines 27-28 from:

username = your DynDNS.org username
password = your DynDNS.org password\\

to:

username = your DynDNS.org username
password = your DynDNS.org password\\

Changed line 62 from:

--

to:

Changed line 64 from:

If you are using DynDNS for a custom domain (like mydomain.com), then you'll have to use a different wget string to update the IP address. It is as follows:

to:

If you are using DynDNS for a custom domain (like mydomain.com), then you'll have to use a different wget string to update the IP address. It is as follows:

Changed line 72 from:

--

to:

Changed line 98 from:

If you use DynDNS wildcards, you should include \&wildcard=NOCHG in the update line.

to:

If you use DynDNS wildcards, you should include \&wildcard=NOCHG in the update line.

Changed line 106 from:

There are a number of perl & similar scripts at DynDNS.org that seem to do the right things.

to:

There are a number of perl & similar scripts at DynDNS.org that seem to do the right things.

January 16, 2005, at 09:02 PM by DaveHooper --
Added lines 5-6:

nb if you have already upgraded BusyBox? then the above might fail- see HowTo.InstallWgetAfterUpgradingBusyBox

December 02, 2004, at 11:05 AM by tlhackque --
Changed lines 94-106 from:

--titoo

to:

--titoo

If you use DynDNS wildcards, you should include \&wildcard=NOCHG in the update line.

This script still doesn't meet the requirements. One must send an update after 28 days even if the ip address hasn't changed. DynDNS will disable your account for abuse if you update too often, and for inactivity if you're lucky enough to have a stable IP address for 30 days. They allow a refresh at 28 days.

I don't have a solution for this within the constraints of a script and the standard shell.

Hint: with bash, one could set an expiration with touch -d 28days /var/tmp/exp.ip, and use && ! /var/tmp/new.ip -nt /var/tmp/exp.ip in the update decision...

There are a number of perl & similar scripts at DynDNS.org that seem to do the right things.

--tlhackque

November 26, 2004, at 08:29 PM by titoo --
Changed lines 68-94 from:

Mookie

to:

Mookie

--

My dyndns provider OVH (ovh.com) is not providing an auto check of the ip address, it means that I need the ip address to be given in the wget string to update the IP address. The provider is also not providing a page to "see" my ip, so I modified the /opt/bin/dnsupd script the following way:

 #!/bin/ash
 #Get the current ip and put it into /var/tmp/tmp.ip
 wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/tmp.ip
 #Parse the answer to get only the ip and put it into /var/tmp/new.ip
 sed -e 's/^.*Address: //' -e 's/<.*$//' /var/tmp/tmp.ip > /var/tmp/new.ip
 if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]
 then echo "No new IP";
 else wget -q http://LOGIN:PASSWORD@www.ovh.com/nic/update?myip=`cat /var/tmp/new.ip`\&hostname=DOMAIN\&system=dyndns --output-document=/var/tmp/upd.ip
 echo "New IP";
 cat /var/tmp/upd.ip;
 rm /var/tmp/upd.ip;
 fi
 rm /var/tmp/old.ip
 rm /var/tmp/tmp.ip
 mv /var/tmp/new.ip /var/tmp/old.ip

Note the backslash (\) before & in the wget string.

For info: http://www.dyndns.org/developers/specs/syntax.html

--titoo

November 16, 2004, at 09:51 PM by Mookie --
Changed lines 58-68 from:

Otte

to:

Otte

--

If you are using DynDNS for a custom domain (like mydomain.com), then you'll have to use a different wget string to update the IP address. It is as follows:

http://USERNAME:PASSWORD@members.dyndns.org/nic/update?system=custom&hostname=DOMAINNAME.COM

Just change USERNAME, PASSWORD, and DOMAINNAME.COM for it to work.

Mookie

November 04, 2004, at 11:33 AM by Otte --
Changed lines 58-60 from:

Otte

to:

Otte

November 04, 2004, at 11:33 AM by Otte --
Changed line 46 from:

Now the script should run every 1 hour\\

to:

Now the script should run every 15 min\\

Changed line 50 from:

1 * * * * root /opt/bin/dnsupd &>/dev/null\\

to:

*/15 * * * * root /opt/bin/dnsupd &>/dev/null\\

November 03, 2004, at 10:35 AM by Otte --
Changed lines 13-14 from:

wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/neu.ip
if [ "`cat /var/tmp/neu.ip`" = "`cat /var/tmp/alt.ip`" ]\\

to:

wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/new.ip
if [ "`cat /var/tmp/new.ip`" = "`cat /var/tmp/old.ip`" ]\\

Changed lines 21-22 from:

rm /var/tmp/alt.ip
mv /var/tmp/neu.ip /var/tmp/alt.ip@@\\

to:

rm /var/tmp/old.ip
mv /var/tmp/new.ip /var/tmp/old.ip@@\\

November 03, 2004, at 10:33 AM by Otte --
Changed line 52 from:

I offer no warrenty of this information!\\

to:

I offer no warranty of this information!\\

November 02, 2004, at 11:54 PM by Otte --
Changed line 46 from:

Now the script should run every 15 min.:\\

to:

Now the script should run every 1 hour\\

Changed line 50 from:

*/15 * * * * root /opt/bin/dnsupd &>/dev/null\\

to:

1 * * * * root /opt/bin/dnsupd &>/dev/null\\

November 02, 2004, at 11:24 PM by Otte --
Changed lines 54-55 from:

''Please, feel free to edit every error or add new information about optimizing or any else...\\

to:

''For your information i use the build UNSLUNG-1.11-beta-V23R25?.bin
Please, feel free to edit every error or add new information about optimizing or any else...\\

November 02, 2004, at 11:20 PM by Otte --
Changed line 1 from:

I have add a workaround to update the DynDNS.org service, because my DSL-Router have no option for this.\\

to:

I have add a workaround to update the dyndns.org service, because my DSL-Router have no option for this.\\

November 02, 2004, at 11:17 PM by Otte --
Changed lines 1-59 from:

Describe DynDNSupdate here.

to:

I have add a workaround to update the DynDNS.org service, because my DSL-Router have no option for this.

Install wget:
ipkg install wget

if not exists /var/tmp create it:
mkdir /var/tmp

Add dnsupd script:
vi /opt/bin/dnsupd

#!/bin/ash
wget -q http://checkip.dyndns.org/index.html --output-document=/var/tmp/neu.ip
if [ "`cat /var/tmp/neu.ip`" = "`cat /var/tmp/alt.ip`" ]
then echo "No new IP";
else wget -q http://username:password@members.dyndns.org/nic/update?hostname=domainname.dyndns.org --output-document=/var/tmp/upd.ip
echo "New IP";
cat /var/tmp/upd.ip;
rm /var/tmp/upd.ip;
fi
rm /var/tmp/alt.ip
mv /var/tmp/neu.ip /var/tmp/alt.ip


replace the following with your datas:
username = your DynDNS.org username
password = your DynDNS.org password
domainname = your registered domainname (i.e. whatever.dyndns.org)


make dnsupd executable:
chmod 755 /opt/bin/dnsupd

The script should start once after reboot:
create S60dnsupd (or use an other number if S60xxx exists...):
vi /opt/etc/init.d/S60dnsupd

#!/bin/sh
if [ -n "`pidof dnsupd`" ]; then
/bin/killall dnsupd 2>/dev/null
fi
umask 077
/opt/bin/dnsupd


make S60dnsupd executable:
chmod 755 /opt/etc/init.d/S60dnsupd

Now the script should run every 15 min.:
vi /etc/crontab

add the following line:
*/15 * * * * root /opt/bin/dnsupd &>/dev/null

I offer no warrenty of this information!

Please, feel free to edit every error or add new information about optimizing or any else...
P.S.: sorry for my bad english.. i'am still learning...

Otte