ChrisRChamberlain
Programmer
Hi all
Have a cron script running every 15 minutes that updates the servers at with current public Dynamic IP address.
The CRONTAB command line is
The content of /var/ is typically
As can be seen, there is no checking of the public IP address to see if any changes have been made. So unless there has been a change, executing the code in /var/ is a waste of time and resources.
So in pseudo code, the script would resemble this:-
If file /var/ does not exist, get the public IP address, save it to /var/ and execute the two wgets. (This is for the first time the script runs only.)
If file /var/ does exist, get the public IP address and save it to a variable. Compare the the content of /var/ to the variable.
If the same, do nothing.
If not the same, save the variable to /var/ and execute the two wgets.
Using this script means the linux server could check the public IP address more frequently than every 15 minutes, and, in theory, would appear to be a more efficient way of updating the servers at
In thread54-1632489, Noway2 provided the necessary code to save the public IP address to both variable and file.
Would appreciate it if someone could fill in the gaps as outlned above.
TIA
PDFcommander.com
motrac.co.uk
Have a cron script running every 15 minutes that updates the servers at with current public Dynamic IP address.
The CRONTAB command line is
Code:
*/15 * * * * /var/www/zoneedit.sh
The content of /var/ is typically
Code:
wget -O - --http-user=MyName --http-passwd=Password '[URL unfurl="true"]http://dynamic.zoneedit.com/auth/dynamic.html?host=www.mysite.net'[/URL]
wget -O - --http-user=MyName --http-passwd=Password '[URL unfurl="true"]http://dynamic.zoneedit.com/auth/dynamic.html?host=mysite.net'[/URL]
So in pseudo code, the script would resemble this:-
If file /var/ does not exist, get the public IP address, save it to /var/ and execute the two wgets. (This is for the first time the script runs only.)
If file /var/ does exist, get the public IP address and save it to a variable. Compare the the content of /var/ to the variable.
If the same, do nothing.
If not the same, save the variable to /var/ and execute the two wgets.
Using this script means the linux server could check the public IP address more frequently than every 15 minutes, and, in theory, would appear to be a more efficient way of updating the servers at
In thread54-1632489, Noway2 provided the necessary code to save the public IP address to both variable and file.
Would appreciate it if someone could fill in the gaps as outlned above.
TIA
FAQ184-2483
Chris PDFcommander.com
motrac.co.uk