for starters the following (untested) script --

#!/bin/sh
ISPA="192.168.1.1"
var1=`ping -c 3 $ISPA | grep "3 packets received"`
if [ $var1 not equal to 0]; then
        echo "connection down"
        # code to change gateway inserted here
# either start a second script or function to check if this ISP came back
        # when the switchover to ISPB begins and accordingly make changes
else
        echo "all fine"
        exit
fi

please do refine it further.

regards,
rka

On 07-Jul-05, at 2:53 AM, Siju George wrote:

On 7/6/05, Rajkumar Andrews <[EMAIL PROTECTED]> wrote:
Further, a shell script could be put as a cron job to ensure that if
the default gateway goes down (ISP-A is out) then the default gateway
ought to be changed to the next (ISP-B) and a monitoring starts to
ensure that ISP-A comes back as default gateway when ISP-A comes back.


actualy I was not able to come up with an optimum solution on how to
detect whether ISP-A has come back while running on ISP-B's gateway
:-(

kind regards

Siju

Reply via email to