*BSD News Article 36556


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!europa.eng.gtefsd.com!news.umbc.edu!eff!wariat.org!hanina.alquds.org!doleh
From: doleh@hanina.alquds.org (Yaser Doleh)
Newsgroups: comp.os.386bsd.questions
Subject: Re: PPP Automatic Reconnect
Date: 5 Oct 1994 04:16:39 GMT
Organization: Alquds Organization
Lines: 67
Distribution: world
Message-ID: <36t9b7$8ti@gazpacho.wariat.org>
References: <36pcge$i9l@nic.hookup.net>
NNTP-Posting-Host: alquds.org

In article <36pcge$i9l@nic.hookup.net>, dirk@caseware.com (Dirk Bach) writes:
|> I'm trying to setup PPP to automatically reconnect when the connection
|> drops.  I was wondering if anyone had any scripts or ideas on how to do
|> this.  I had slip setup to do this quite nicely, but for several
|> reasons, I need to run PPP.  
|> 
|> Any help would be appreciated.
|> 

I have the following scripts
I run ppp-check every 5 minutes from cron.

#!/bin/sh
#
# ppp-check
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH
ping -c 1 ppp-remote
if [ $? = 0 ]; then
    exit 0
fi
/usr/local/etc/ppp-off
sleep 5
/usr/local/etc/ppp-on
exit 0

#!/bin/sh
#
# ppp-on
#
/usr/libexec/pppd modem crtscts defaultroute connect /usr/local/etc/ppp-call ppp 57600

#!/bin/sh
#
# ppp-off
#
pid=-1
if [ -f /var/run/ppp0.pid ]; then
    pid=`cat /var/run/ppp0.pid`
fi
if [ -f /proc/$pid ]; then 
    kill $pid
    exit 0
fi
exit 1

#!/bin/sh
#
# ppp-call
#
chat -v ABORT "NO CARRIER" ABORT BUSY "" ATZ\\d\\d OK AT\\d OK ATDT5551212 \
 CONNECT "" ogin xxx assword: xxxx >/dev/ppp </dev/ppp

|>  - D
|> 
|> Dirk Bach (dirk@caseware.com)
|> WK Information Systems Ltd. 
|> 70 Richmond St. E #400
|> Toronto, ON
|> M5C 1N8

-- 

Very truly yours
Yaser Doleh
doleh@alquds.org