On Mon, 2003-07-07 at 10:57, [EMAIL PROTECTED] wrote:
> would this still work, even thought i have no control over the actual IP address 
> assignment?
> 
> The server is in one locatation, I use a company for my DNS.
> 

All this script does is determine your default gateway, and try to ping
it. Even if your gateway changed regularly it would still work. If you
want to ping a particular ip(example 1) you could modify the script to
do so, or if your server uses dyndns you could just ping the server name
(example2).

Example 1

#!/bin/sh

ping -c1 123.456.789.1

if [ "$?" != "0" ] ; then
    /etc/rc.d/netaddress.down
    /etc/rc.d/netaddress.up
fi      


Example2
#!/bin/sh

ping -c1 myserver.domain.com

if [ "$?" != "0" ] ; then
    /etc/rc.d/netaddress.down
    /etc/rc.d/netaddress.up
fi      




-- 
Neil Jolly

(with Yoda-like voice)
"Confrontation leads to anger...  Anger leads to fear...  Fear leads
to using Windows NT in mission-critical combat systems...  And this is
how the ancients fell...

Reply via email to