On Tue, Mar 21, 2000 at 08:53:49AM +1100, Stephen M Lavelle wrote:
> i have a cron job which dials up isp at 8am each morning.
> I need a small script which can check (periodically) if the link is
> still up and if it is not then redial and reconnect.
> Any pointers/examples please?
> Regards,
> Steve
> PS. I am not interested in using diald or the demand option of pppd

Not tested:

while true; do

 if ! ifconfig | grep ppp0 >/dev/null; then
  <redial or whatnot>
 fi

 sleep $INTERVAL

done


If the connection is flaky, you might want to add something like
fping your nameserver or somesuch. From experience, it is possible
(but unlikely) for ifconfig to show ppp is up, but the connection is
so bad, it is worthless. I used to get this occasionally with a noisy
phone line.

-- 
Hal B
[EMAIL PROTECTED]
--


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to