On Fri, 23 Feb 2001, Jun Tanamal wrote:
> Hey! That's a BRIGHT idea!!! how will I do that?
>
> Jun Tanamal
>
> "Ian C. Sison" wrote:
>
> > WHy not just have a daemon script testing for connectivity via 'ping' and
> > if the next point is unreachable, issue the command to restart HDLC or
> > power cycle the modem (yes there are such devices!)
> >
try this script
#!/bin/bash
# replace this with the remote site's ip address
REMOTE_SITE=192.168.0.1
if ping -c 3 $REMOTE_SITE >> /dev/null ; then
echo remote site is up
# i still like the program to report even the link is
# ok so i'd know that the script is still being run
# by cron
else
echo remote site is down
# remote site is down, insert commands here
# to reinitialize connection
fi
# EOF script end
then have cron run this every 5 minutes or so ...
just be aware though, that it is possible for ping to fail even though the
remote site is ok ... this happens especially when the link is heavily
loaded.
hth
-mark
*************************************************************************
Mark Anthony J. Mercado [EMAIL PROTECTED]
Laguna Internet, Incorporated
Rm 404 Vega Centre, Lopez Avenue, Los Banos, Laguna, Philippines 4030
Ph. 63 49 536.0085 Fax. 63 49 536.0067
*************************************************************************
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]