Hello,

I'm taking another approach: I have a process running, which makes sure the connection is up every minute. The advantage is that if I don't want ADSL connection for a while, I can kill a process, not crond.

This script has terrible bash syntax, but it has proven to work well for over a couple of years, including those days when the connection went down a few times a day. Only my username has been changed.

Eli

#!/bin/bash
while true; do {
/usr/sbin/pptp 10.0.0.138 user "[EMAIL PROTECTED]" remotename "10.0.0.138 RELAY_PPP1" defaultroute netmask 255.0.0.0 mtu 1452 mru 1452 noauth lcp-echo-interval 60 lcp-echo-failure 3 nobsdcomp usepeerdns
sleep 60; # One minute is enough to connect...
myPID=`ls /var/run/ppp?.pid`; # Check up
if [ $myPID ]; then {
while [ -f $myPID ]; do { sleep 60; } done;
}
fi;
killall -w pptp
rm -f /var/run/pptp/10.0.0.138
}
done;



Noam Rathaus wrote:


Hi,

I have implemented the following Crontab record to monitor my ADSL, and bring it up 
when it comes done:
if ! ping -c 1 -n 192.114.47.250 > /dev/null ; then killall -KILL pptp ; logger ADSL 
connection stopped ; /usr/sbin/adsl-up ; logger ADSL connection started; fi

It doesn't work well :(, I get a lot of "/bin/sh ping..." entries in the process list, consuming a lot of memory.

Does anyone have a better solution?

Thanks
Noam Rathaus
CTO
Beyond Security Ltd.
http://www.securiteam.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]






--
Web: http://www.billauer.co.il



=================================================================
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]



Reply via email to