just run the Connect script every t minutes ?
after all , it won't make new if exist. (talking about 012 cable-start
script)
or am I missing a something here .. ?
on 2nd thought , what does it mean in fact "connection lost" ?? after
all both sides are configured in memory (routing table) and files .
There must be some flag raised for erased data or link ( as in chain) .
So it would be neat to go directly to that flag ( say, what ifconfig
actually checks), and perhaps "restore connection" is a much simpler
thing to implement than what i wrote above.
My issue with 012-Slax is that I don't seem to get a working hot
gateway , thus all Ping IPs are "unreachable" . rrr
This thread might be usefull for me..
GL
ציטוט [EMAIL PROTECTED]:
Thanks that is what I was looking for,
Aaron
Quoting "Geoffrey S. Mendelson" <[EMAIL PROTECTED]>:
On Tue, Jun 20, 2006 at 08:12:57AM +0300, [EMAIL PROTECTED] wrote:
I am looking for an elegant solution to my internet connecivity.
I use a script called cablecheck. It runs every minute and if there is no
PPP connection, it runs a script called cablestart.
-----------------------------------------------------------
#!/bin/bash
X=`ifconfig ppp0 2>/dev/null`
if [ " $X" == " " ] ; then
/usr/local/bin/cablestart
fi
-----------------------------------------------------------
The relevant parts of cablestart are:
-----------------------------------------------------------
#!/bin/bash
CPS=`ps -ax | grep cablestart | grep -cv grep `
echo "cps is " $CPS
if [ "2" == "$CPS" ] ; then
echo "ok starting cable connection"
else
echo "cablestart is already running."
exit
fi
PS=`ps -ax | grep dhclient | grep eth1 | awk "{print \\$1}"`
if [ " " != " $PS" ] ; then
echo "killing dhcp client for eth1 psid " $PS
kill -KILL $PS
else
echo "no dhcp client running for eth1 (good)"
fi
PS=`ps -ax | grep cable.netvision.net.il | grep pptp-linux | awk "{print
\\$1}"`
if [ " " != " $PS" ] ; then
echo "killing pptp client for netvision psid " $PS
kill -KILL $PS
else
echo "no pptp client running for netvision (good)"
fi
echo "shutting down eth1"
/sbin/ifdown eth1
echo "restarting eth1"
/sbin/ifup eth1
-----------------------------------------------------------
It's probably sloppy code, but it works. It check to make sure there is
not already a cablestart running and if there is none, starts one.
Geoff.
--
Geoffrey S. Mendelson, Jerusalem, Israel [EMAIL PROTECTED] N3OWJ/4X1GM
IL Voice: (07)-7424-1667 IL Fax: 972-2-648-1443 U.S. Voice: 1-215-821-1838
Visit my 'blog at http://geoffstechno.livejournal.com/
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]