Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Feb 1998 14:30:21 -0600
From:      Child <child@prairie.lakes.com>
To:        Kwoody <kwoody@citytel.net>, Brian Somers <brian@Awfulhak.org>
Cc:        freebsd-questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: small script question.. 
Message-ID:  <3.0.3.32.19980204143021.00ef07a4@192.168.0.10>
In-Reply-To: <Pine.BSF.3.91.980204105901.26597C-100000@mybsd.net>
References:  <199802040136.BAA21583@awfulhak.org>

next in thread | previous in thread | raw e-mail | index | archive | help
this works even better here is linkwatch.sh
run it as root linkwatch & it checks even min and only restarts as long as
it HAS to! even catchs half dead links :))

#!/bin/sh
#
ADMIN=child
WATCH=your.isps.gateway.ip
RESTART='killall ppp ; /usr/sbin/ppp -auto city > /dev/null &'

while [ true ]; do
for minute in 1 2 3; do
  sleep 60
  if [ X"`/sbin/ping -nc3 ${WATCH} | /usr/bin/grep '100%'`" != X ]; then
       ${RESTART}
       echo mpd restarted | /usr/bin/Mail -s "auto restart ppp" ${ADMIN}
    else
 fi

done
done
exit




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.3.32.19980204143021.00ef07a4>