home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso
/
altsrc
/
articles
/
11356
< prev
next >
Wrap
Internet Message Format
|
1994-10-18
|
3KB
Path: wupost!math.ohio-state.edu!howland.reston.ans.net!vixen.cso.uiuc.edu!uwm.edu!msuinfo!harbinger.cc.monash.edu.au!yarrina.connect.com.au!eplet.apana.org.au!suburbia.apana.org.au!proff
From: proff@suburbia.apana.org.au (Julian Assange)
Newsgroups: apana.general,comp.protocols.ppp,alt.sources
Subject: PPP auto redial on link failure
Date: 18 Oct 94 06:51:56 GMT
Organization: Suburbia Public Access Unix +61-3-5968366
Lines: 79
Message-ID: <proff.782463116@suburbia.apana.org.au>
NNTP-Posting-Host: suburbia.apana.org.au
Keywords: ppp,link
X-Newsreader: NN version 6.5.0 #2
X-Comment0: --------------------------------------------------
X-Comment1: 6 lines - Internet Connection - IRC/FTP/Telnet
X-Comment2: Every user receives 4 hours a month FREE access!
X-Comment3: --------------------------------------------------
Xref: wupost comp.protocols.ppp:7367 alt.sources:11356
I use the following scripts to start, monitor and automatically restart
our ppp link. I hope you find them useful.
Cheers,
Proff
#!/bin/sh
#/etc/ppp.link
read PATH </etc/PATH
# Set up a PPP link
#
dial=atdt555-5555
speed=38400
#
fuser -INT -k /dev/link
sleep 5
fuser -k /dev/link
stty raw $speed crtscts </dev/link
sleep 3
echo -n "+++" >/dev/link
sleep 3
echo -ne "at\\r" >/dev/link
sleep 1
exec pppd connect 'chat -t 60 -v ABORT "NO CARRIER" ABORT BUSY \
"" ATZ OK "ATH%C1&D2&K3X4M1L3" OK '$dial' CONNECT' \
crtscts defaultroute /dev/link $speed mru 512
--cut--
#!/bin/sh
#/etc/netmon
read PATH </etc/PATH
retry=60
dropped=0
router=werple2.gw
>/etc/netstatus
while true
do
[ -e /etc/norelink ] && { sleep 60; continue; }
if ping -c 100 $router | fgrep icmp_seq | head -1 | fgrep icmp_seq >/dev/null 2>&1
then
if [ $dropped -eq 1 ]
then
>/etc/netstatus
wall <<emsg
The link is back up! You may now once again use irc, gopher, ftp, ncftp,
telnet, pmf, talk, nslookup, rsh, tin or nn (news), as well as everything else.
- Admins.
emsg
fi
dropped=0
retry=600
sleep 600
continue
else
[ $dropped -eq 1 ] && sleep $retry
dropped=1
if [ $retry -lt 3600 ]
then
retry=`expr $retry + 500`
fi
tee <<eof /etc/netstatus|wall
The link is down, for reasons unknown. We are attempting to rectify
the link status at this very moment. In the mean time, don't use irc,
gopher, ftp, ncftp, telnet, pmf (MUDs), talk, nslookup, rsh, tin or
nn (news). Everything else should work correctly.
- Admins.
eof
mail <<eofmail root
Restarting ppp link...
eofmail
/etc/ppp.link
continue
fi
done