From: "James Bremer" <tereknor@eve.local.net>
To: <axp-list@redhat.com>
Subject: Re: scripts and the 'at' command
Date: Sun, 28 Mar 1999 10:31:18 -0800 [thread overview]
Message-ID: <006001be7949$2c676660$0100a8c0@gracie.tereknor.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 859 bytes --]
> I have written a short simple script that checks to see if my ppp
> link is up and if is not, spawns my dialer script. The last line of
> the script uses the 'at' command to run the script a few minutes
> later.
I wrote a background shell script for my Sun that checks 'ifconfig -a' for
the presence of ppp every five minutes or so, and if it's not there,
restarts it. The scripting is based on the file locations of the ppp
freeware, so adjust for linux accordingly.
Side note - I'm not sure how your copy of 'wc' might behave. When I ported
this from SunOS to Solaris, I noticed that 'wc -l' in SunOS will report a
line if there is a null line or a character, whereas in Solaris 'wc -l' will
only report a line if there is an actual character on that line. Again,
adjust accordingly.
It works fine for me...
James Bremer
tereknor@tereknor.com
[-- Attachment #2: pppcheck --]
[-- Type: application/octet-stream, Size: 632 bytes --]
#!/bin/sh
PPPDIR=/etc/ppp
LOCKDEV=ppp0.pid
x=1
while [ x > 0 ]; do
`ifconfig -a | grep ppp | cut -f 1 -d : > /tmp/out`
if [ `cat /tmp/out | wc -l` = "1" ]; then
sleep 300
else
if [ -f /usr/local/bin/pppd ]; then
if [ -f $PPPDIR/$LOCKDEV ]; then
rm -f $PPPDIR/$LOCKDEV
fi
/usr/local/bin/pppd -d call local
if [ $? = "0" ]; then
echo "PPP Started..."
$PPPDIR/ip-up
else
echo "Startup failed, see syslog for details"
fi
else
echo "pppd not found, exiting..."
exit 1
fi
echo `date` > /tmp/pppcrash
fi
done
next reply other threads:[~1999-03-28 18:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-28 18:31 James Bremer [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-03-27 15:48 scripts and the 'at' command Bob Segrest
1999-03-27 16:26 ` Rusty Lingenfelter
1999-03-30 18:40 ` Michael Tibor
1999-03-27 19:39 ` Konrad Podloucky
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox