From owner-freebsd-questions@FreeBSD.ORG Fri May 2 06:44:36 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 7018137B401 for ; Fri, 2 May 2003 06:44:36 -0700 (PDT) Received: from cwe.compwest.com.au (compwest.com.au [202.72.147.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC59243FB1 for ; Fri, 2 May 2003 06:44:34 -0700 (PDT) (envelope-from paul@compwest.com.au) Received: from wks (ant.parkview.compwest.com.au [202.72.147.43]) by cwe.compwest.com.au (8.12.6/8.11.6) with SMTP id h42DiU9o026775 for ; Fri, 2 May 2003 21:44:32 +0800 (WST) (envelope-from paul@compwest.com.au) From: "Paul Hamilton" To: "Freebsd-Questions" Date: Fri, 2 May 2003 21:44:33 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal Subject: auto restarting a ppp connection 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, 02 May 2003 13:44:36 -0000 Hi All, I am running FreeBSD 4.7, and using the built in ppp (and ppp nat), software to make a pppoe connection. Once or twice a month my ISP does something that causes my connection to be blocked. The only way to fix this is to kill the ppp connection and re-start it. I have tried to put the whole routine into a script, ie, find the pid, kill it, wait, then restart the ppp connection. The idea, was that I could link it with a ping tester, then when I miss 'x' number of pings, restart the connection. This is what I used:- --snip--- PPP=`ps -ax | grep "ppp -nat" | grep -v "grep" | cut -c 1-6` if test $PPP #if test $PPP != "" then kill -15 $PPP echo Wait for 5 seconds to properly kill the old PPP process printf "%s" "." sleep 1 printf "%s" "." sleep 1 printf "%s" "." sleep 1 printf "%s" "." sleep 1 printf "%s" "." sleep 1 printf "%s\n" "." sleep 1 else echo echo No PPP process found to kill fi ---snip--- I found that my script had problems with killing the ppp pid, in that it didn't really kill the ppp process, until the script had exited. My question is, is there a port/package that will automatically look after a FreeBSD ppp link? If so, what are your experiences, with the best one? Cheers, Paul Hamilton