[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Writting scripts

On Tue, May 08, 2007 at 02:10:29PM +0100, John Fieldsend wrote:
> hope some of you can help or give me pointers on where to start
> I want to write a script that will execute ecery 30 mins, the script
> will get my networks WAN IP using
> wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e
> 's/<.*$//'
> i need to store that IP address in a variable then get the script the
> goto a url and submit the WAN IP in the url
> can this be done by executing a perl script
> any advise would be appreciated

Cron can take care of running it every 30 minutes.  I would forget about
a variable since that will be nearly imposible to make work, and just
use a tmp file to store the value.

Of course it could be what you are trying to do is not optimal.  For
example of what you are trying to do is update a dyndns value whenver
your IP changes, you may actually be much better off calling a script
from dhcp or ppp (whichever you get your IP from) to update things.  I
guess if you are using one of those silly router boxes that you can't do
scripts on, well then you don't have any such ability and would have to
do it from an inside machine that checks the external IP regularly.

Len Sorensen

Reply to: