keeping an occasional ping alive

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: J.L.Francoisfrenchie@magusnet.gilbert.az.us
Date:  
Subject: keeping an occasional ping alive
It seems like on Thu, Jul 06, 2000 at 08:30:16PM -0700, Craig White scribbled:
Orig Msg> I read man ping and found that I can ping address -i30 -q but I want that
Orig Msg> process in the background so I get a shell prompt so I add an ampersand to
Orig Msg> the line to make it...
Orig Msg>
Orig Msg> ping (address) -i30 -q &
Orig Msg>
Orig Msg> but it still doesn't return to the shell prompt unless I hit return a second
Orig Msg> time - why? can anyone clue in the clueless? Is this a reasonable way to do
Orig Msg> this?
Orig Msg>

make a crontab entry:
30 * * * * /usr/local/bin/chkisdn.sh

use a script like this and name it chkisdn.sh:

======================CUT HERE===============
#!/bin/bash
if /bin/ping -c20 <INSERT DOMAIN>.com | grep time=
then
    echo "ISDN is Up and Running!"
else
    cd /usr/local/isdn; isdn-stop
    /usr/bin/sleep 10
    echo " ISDN Restarted!!! "
    cd /usr/local/isdn; isdn-start
fi
======================CUT HERE===============


Unless you have MAILTO="" in your crontab this will
mail the echo information to root on a regular interval
so you know that everything is ok or if it went down, when.

Make sure you edit this to point to any required scripts
already made to start/stop ISDN.

YMMV.

Jean Francois Sends...
President & CEO - MagusNet, Inc., MagusNet.com, MagusNet.Gilbert.AZ.US
Director Of Managed Services - OpNIX,Inc., www.opnix.com
OpNIX - Simply Better Bandwidth
602-770-JLF1 - Cellular, ICQ: 8137851