Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

gateway transfer in linux..

I m doing a project in Linux for effectively implementing proxy server..
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
[1353 byte] By [san_eec] at [2007-11-11 8:30:04]
# 1 Re: gateway transfer in linux..
These are the FreeVBCode forums, meaning they are intended for Visual Basic programmers. You're more likely to receive a reply if you post this question to a Linux forum.
Phil Weber at 2007-11-11 17:25:22 >