From owner-freebsd-questions@FreeBSD.ORG Thu Jun 5 23:42:35 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E005D37B401 for ; Thu, 5 Jun 2003 23:42:35 -0700 (PDT) Received: from ctb-mesg1.saix.net (ctb-mesg1.saix.net [196.25.240.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id C15D043F93 for ; Thu, 5 Jun 2003 23:42:31 -0700 (PDT) (envelope-from mark@netchat.co.za) Received: from inf.co.za (cometorbit.com [196.15.137.96]) by ctb-mesg1.saix.net (Postfix) with SMTP id 2CCF839B7A for ; Fri, 6 Jun 2003 08:42:28 +0200 (SAST) Received: (qmail 6888 invoked by uid 85); 6 Jun 2003 06:35:31 -0000 Received: from mark@netchat.co.za by foxtrot.inf.co.za by uid 82 with qmail-scanner-1.16 (clamscan: 0.54. spamassassin: 2.54. Clear:. Processed in 0.520714 secs); 06 Jun 2003 06:35:31 -0000 X-Qmail-Scanner-Mail-From: mark@netchat.co.za via foxtrot.inf.co.za X-Qmail-Scanner-Rcpt-To: freebsd-questions@freebsd.org X-Qmail-Scanner: 1.16 (Clear:. Processed in 0.520714 secs) Received: from localhost (HELO mail.netchat.co.za) (127.0.0.1) by inf.co.za with SMTP; 6 Jun 2003 06:35:30 -0000 Received: from 196.37.44.152 (proxying for 10.0.5.2) (SquirrelMail authenticated user mark@netchat.co.za) by mail.inf.co.za with HTTP; Fri, 6 Jun 2003 08:35:30 +0200 (SAST) Message-ID: <21585.196.37.44.152.1054881330.squirrel@mail.inf.co.za> Date: Fri, 6 Jun 2003 08:35:30 +0200 (SAST) From: "Mark Pearce" To: freebsd-questions@freebsd.org User-Agent: SquirrelMail/1.4.0 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 Importance: Normal Subject: Advise needed to write a script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2003 06:42:36 -0000 Hi I have a permanent internet connection using modems. Every now and then I loose my connection, or at least, I loose the IP but I remain connected. If I reboot my box, I come back online with the IP address and everything works 100%, then a while later the IP dissapears but I remain connected. I have found 2 ways to resolve this, either reboot the server or write a script that kills and restarts ppp, I am using userland-ppp. What I would like to do is the following. create a script that runs contineously in the background, checking on the IP address every 5 minutes, and if it's not there, run a script to kill and restart ppp. I have no clue where to start on this. I'd appreciate any info on writing something or pointing me in the right direction to resolve this problem. Thanks Mark