On Fri, 2004-03-26 at 17:14, Amanda wrote:
> Have a pptp connection from SME server to windows 2000 vpn server.
> I'm looking for a bash script which will periodically (launched from cron) ping
> a machine on the remote network and restart pptp if it doesn't respond.
> 
> I wrote a similar thing for dos years ago which captured the output of ping into
> a text file, then looked for the string "reply from".

The heart of your inner loop will inspect the return code of ping. It'll
be 0 if the connection is up and non-zero if it's not. So you'll want
something like this:

if ! ping -c 1 -w 5 host.domain.tld; then service pptp restart; fi

wrap that in a while 1 loop and you should be done.

j.


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to