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?

Run this using cron:

!#/bin/sh
if [ `/sbin/route -n | /bin/grep -c "^0.0.0.0"` = 0 ]; then
  /usr/sbin/usernetctl ppp0 up
fi

This assumes there is no default route unless the dialup link is up.

Tony
-- 
 Anthony E. Greene <[EMAIL PROTECTED]>
 Homepage & PGP Key <http://www.pobox.com/~agreene/>
 If it's too good to be true, it's probably Linux.


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

Reply via email to