A quick script would be
#!/bin/sh
while (1)
do
ping ping -c1 isp.domain.com > /dev/null 2> /dev/null
sleep 240
done;
It will ping you ISP every 4 minutes. If you want to kill it, use a ^C
You should check to make sure you have the your ppp connect up before trying
to ping anything, and then modify anything that is Red Hat specif.
Jack
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <unlisted-recipients:; (no To-header on input)>
Cc: linux-newbie <[EMAIL PROTECTED]>
Sent: Thursday, December 30, 1999 7:20 AM
Subject: Shell script pinging for HR6.1
> I would appreciate it if someone could explain to me how to adapt this to
> RH6.1.
>
> Thanks in advance.
>
> Frank Roberts
>
> Scott Felton wrote:
>
> > 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