Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: askelon on May 08, 2005, 10:49:08 AM

Title: dyndns script
Post by: askelon on May 08, 2005, 10:49:08 AM
I dont seem to be able to get the inbuilt dyndns settings working but have come across the following script.  Its currently set to do an update no matter what every 28 days (dyndns deletes your domain if you dont) but I'd like it to check every 5 mins but am not too sure how to do this.  If someone could help me out I'd be greatly appreciative.  Once the scripts done I take it I need to stick a loop into it at the end and then install it into a startup scripts directory somewhere? Anyway its as follows:  

 #!/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.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://username:password@members.dyndns.org/nic/update?hostname=name.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
Title: Re: dyndns script
Post by: CharlieBrady on May 08, 2005, 06:22:05 PM
Quote from: "askelon"
I dont seem to be able to get the inbuilt dyndns settings working but have come across the following script.  Its currently set to do an update no matter what every 28 days (dyndns deletes your domain if you dont)


The inbuilt client does an update every week no matter what.

Quote

... but I'd like it to check every 5 mins ...


What advantage is there is trying to update every 5 mins?

Bottom line is if there is something wrong with the inbuilt client, report details of the problem to the bug tracker on this website and you'll make it possible for someone to fix it.
Title: dyndns script
Post by: funkusmunkus on May 09, 2005, 07:34:13 AM
if you set it to update every 5 min's you might get banned from dyndns.

once a day is enough, you'll find etc/cron.weekly/refresh-ddns
refreshes once a week, maybe you could create a template and put in and does the same as refresh-ddns and put in /etc/cron.daily/  someone might give you a little more incite, I'm fairly new to this my self.

cheers