gateway transfer in linux..
I have configured a proxy server in Linux(Squid)..
Formed a LAN setup with 2 systems connected to it..
now initially i have activated one gateway(DSL).
If this gateway fails, i have to activate the other gateway(BSNL) through my script code..
I m sending my code as follows..
#! /bin/bash
while true
do
if [ $# -ne 1 ]
then
echo Usage: $0 hostname
exit 1
fi
if [ `ping -c 1 $1 | grep -c 'bytes from'` -ne 0 ]
then
echo Online: $1
exit 0
else
service squid stop
cp /etc/squid/dsl.conf /etc/squid/squid.conf
cp /etc/resolvD.conf /etc/resolv.conf
system-config-network-cmd --profile BSNL --activate
service squid start
echo Offline: $1
exit 1
fi
done
when i run this code as [/B]sh failover 198.133.219.25[/B]
even when the gateway is failed, the first if part of my code alone is working..
I feel tat now bth the gateway r activated,i dnt knw how to activate one gateway and deactivate the other..
I have also created a profile named BSNL and have activated bsnl device in tat profile and in the common profile activated LAN and DSL..
Just can even give me a solution to cmplete my proj
regards
Sangeetha

