From owner-freebsd-hackers Sat Mar 7 07:53:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA20928 for freebsd-hackers-outgoing; Sat, 7 Mar 1998 07:53:43 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from apollo.ptway.com (apollo.ptway.com [199.176.148.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA20912 for ; Sat, 7 Mar 1998 07:53:33 -0800 (PST) (envelope-from haskin@ptway.com) Received: from brianjr (116R1.infinitecom.com [199.176.148.59] (may be forged)) by apollo.ptway.com (8.8.7/8.8.7) with SMTP id KAA24715; Sat, 7 Mar 1998 10:55:24 -0500 Message-ID: <001e01bd49e1$1aa91600$0b00000a@brianjr.haskin.org> From: "Brian Haskin" To: , "allen campbell" Cc: Subject: Re: Detecting state of PPP Date: Sat, 7 Mar 1998 10:52:32 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----Original Message----- From: Richard M. Neswold To: allen campbell Cc: hackers@FreeBSD.ORG Date: Saturday, March 07, 1998 1:26 AM Subject: Re: Detecting state of PPP >On Fri, 6 Mar 1998, allen campbell wrote: > >> I think ppp deserves a status tool that performs simple tests on the >> running daemon. > >Here's a ppp status tool (put this in a file called, for instance, >'ppp_up'): > > #!/bin/sh > ifconfig -l -u | grep -q tun0; > >To test it: > > $ ppp_up && echo PPP is running. > > Rich > umm, this will tell you if the interface is up or not, i.e. if ppp is running. The original question was how, using userland ppp with the auto dial mode do you tell if ppp is currently connected. Your test would always show that the interface is up even when the modem is not actually connected, because the ppp is keeping the interface up and when it actually receives an outgoing packet it will dial. Others have pointed out various methods of checking this, varying from using pppctl to checking for a lock on the serial port. Brian Haskin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message