i also wrote a short script being run by cron:
/usr/sbin/checkppp
=====================================================================
/bin/ping -c 5 router1 > /tmp/pingresult 2>&1
count=`grep 'packets' /tmp/pingresult |awk '{print $4}'`
if [ $count = 0 ]
then
echo "re-dialling..."
/usr/sbin/dialupscript
fi
=====================================================================
when cron runs the script, it detected that ppp0 is down, it then
execute /usr/sbin/dialupscript and then it says "Connect script failed".
BUT if i execute /usr/sbin/checkppp from the command line, it works fine.
i also have the same /usr/sbin/dialupscript in rc.local and its also
connecting.
i also tried the script below but it wont connect through cron, through
command line is fine.
thanks.
jun
On Thu, 25 May 2000, Barny Chiw wrote:
> Jun Garin wrote:
> >
> > ipchains also from 'ps -ef'. and .. isa pa!
> > is there an auto-redial once dialup goes down ?
> >
> > thanks.
> > jun
> >
>
> Hello, we have this script called ppp-check w/c
> is run by cron every 5 mins:
>
> ================================================================
>
> # Use with CRON utility
> # Check every 5 minutes if PPP is running. If not, fire up PPP
>
> if test -e "/var/run/ppp0.pid"
> then
> exit 0
> else
> echo "PPP is down. Firing up PPP."
> /etc/ppp/ppp-on
> # sleep 20s
> sleep 1m
> if test -e "/var/run/ppp0.pid"
> then
> echo "Reconnection OK."
> else
> echo "Reconnection FAILED."
> fi
> exit 1
> fi
>
> ================================================================
>
>
> hhmmm... ano pala kina-iba ng exit 1 sa exit 0 ?
>
> --barny
>
> -
> Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
> To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
>
-
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]