In Slackware 3.6 I had always run a script called "keepalive.sh" that
keeps my ISP connection up. I stole it from the Dynamic-IP-Hacks
mini-HOWTO. It runs from root's crontab.

Now that I've upgraded to Slackware 7.0 it doesn't seem to work and I
get this error in my root mailfile (now that I stopped redirecting it
to /dev/null)...

> To: [EMAIL PROTECTED]
> Subject: cron: /sbin/keepalive.sh
> 
> /sbin/keepalive.sh: line 8: syntax error near unexpected token `else'
> /sbin/keepalive.sh: line 8: `else'

Here is the shell script pasted from an xterm...

#!/bin/sh
#
# Script to keep the ppp0 port up by pinging and then grepping results
#
if [ -f /var/run/ppp0.pid ] ; then
 ping -c5 -l3 204.249.184.2 2>&1 | grep "0 packets" > /dev/null && \
 { /usr/sbin/ppp-off > /dev/null 2>&1 ; sleep 2 ; /usr/sbin/ppp-go }
else
 /usr/sbin/ppp-go
fi
# Done

I think it is a verbatim copy of the example in the mini-HOWTO except
I use ppp-go and ppp-off and like I said, I think it worked fine in my
old setup. Can anyone spot what is wrong and why bash is complaining?
Thanks...


-- 
Scott Felton WF3R
[EMAIL PROTECTED]
http://www.k3ir.ampr.org
Slackware Linux

Reply via email to