There was smth called ppp-watch once. Personally, I use ip.up and ip.down scripts called by ppp when connection goes up or down to notice this events and check if the connection down was intentional. If it is not - a script is being run that attempts to re-connect each 5 minutes until successful.
Regards, Gregory. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, June 20, 2006 8:13 AM To: linux-il@linux.org.il Subject: (no subject) Hi all, I am looking for an elegant solution to my internet connecivity. I use actcom and connect with a script. What I want is some fine tuning. I would like the script to run. When my computer reboots (which isn't often, its Linux after all) When my connection dies (this is the most important since I often access my home computer from work) I was given a script to use with cron, but I never found that it worked for me, but I could be something I am doing wrong. I would prefer a more elegent approach which checks to see if I am connected, the way I do manually ie ifconfig and pinging a known address. If the connection is down then run the connect script. Any ideas would be most helpful. I will paste the various scripts I have at the end of this email. Thanks, Aaron ------------------------------------- [EMAIL PROTECTED]:/usr/sbin# cat ptstart #!/bin/sh # Put your connection startup commands here VPN="172.26.255.198" USER="[EMAIL PROTECTED]" MTU="1350" CABLEGW=`route -n | grep ^0.0.0.0 | awk '{ print $1 }'` cat /etc/ppp/resolv.conf > /etc/resolv.conf route del default #route add 172.26.255.198 gw $CABLEGW route add 172.26.255.198 gw 172.25.96.1 PPTP=`which pptp` $PPTP $VPN user $USER defaultroute noauth mtu $MTU exit 0 [EMAIL PROTECTED]:/usr/sbin# ------------------------------------------- [EMAIL PROTECTED]:/usr/sbin# cat ptstop #!/bin/bash #Put your connection stop commands here killall pptp exit 0 /etc/init.d/networking restart [EMAIL PROTECTED]:/usr/sbin# --------------------------------------------- [EMAIL PROTECTED]:/usr/sbin# cat ptcron #!/bin/sh TESTHOST="198.133.219.25" #Host to ping-test: cisco.com STOPSCRIPT="/usr/sbin/ptstop" #Script to stop a connection STARTSCRIPT="/usr/sbin/ptstart" #Script to start a connection #Make sure we don't have 2 instances on this script running at once [ -e /var/run/ptcron.pid ] && exit 0 touch /var/run/ptcron.pid # The actual connectivity testing is right here PING=`which ping` if $PING -c 3 -n $TESTHOST > /dev/null; then exit 0 rm -f /var/run/ptcron.pid fi echo -e "Link is dead, reloading" $STOPSCRIPT # wait a little while to let the pppd processes to shut down sleep 2 $STARTSCRIPT rm -f /var/run/ptcron.pid exit 0 [EMAIL PROTECTED]:/usr/sbin# ---------------------------------------------- :) ================================================================= 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]