From owner-freebsd-hackers Fri Mar 6 21:51:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA28484 for freebsd-hackers-outgoing; Fri, 6 Mar 1998 21:51:27 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from const. (tulip14.verinet.com [199.45.181.206]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA28474 for ; Fri, 6 Mar 1998 21:51:18 -0800 (PST) (envelope-from allenc@verinet.com) Received: (from allenc@localhost) by const. (8.8.8/8.8.8) id WAA20509 for hackers@freebsd.org; Fri, 6 Mar 1998 22:51:34 -0700 (MST) (envelope-from allenc) Date: Fri, 6 Mar 1998 22:51:34 -0700 (MST) From: allen campbell Message-Id: <199803070551.WAA20509@const.> To: hackers@FreeBSD.ORG Subject: Re: Detecting state of PPP Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >> How does one go about writing a program to check if a PPP link is up > >> or down? > > > > I've seen lots of complicated responses to this, so there is probably > > something inherintly wrong with what I've always done, check for the > > existence of the /var/spool/lock/LCK..cuaa? > > Why not just look at the interface status: [Ensuing example deleted] In the case of user land ppp, take a look at the pppctl(8) man page. It provides an example of how to check the status of ppp, among other things. Even pppctl leaves much to be desired; essentially to provides a way to control a running ppp daemon as though you are using the telnet socket. You must then parse the output from the session to get answers. I think ppp deserves a status tool that performs simple tests on the running daemon. Perhaps: if pppstat --linkup section then do something requiring 'section'. fi Allen Campbell allenc@verinet.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message