From owner-freebsd-questions Sun Dec 31 20: 5:15 2000 From owner-freebsd-questions@FreeBSD.ORG Sun Dec 31 20:05:13 2000 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by hub.freebsd.org (Postfix) with ESMTP id 58C8837B400 for ; Sun, 31 Dec 2000 20:05:12 -0800 (PST) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 33B4D6A911; Mon, 1 Jan 2001 14:35:09 +1030 (CST) Date: Mon, 1 Jan 2001 14:35:09 +1030 From: Greg Lehey To: Cliff Sarginson Cc: questions@freebsd.org Subject: Re: Last question this year. Am I connected ? Message-ID: <20010101143509.D44043@wantadilla.lemis.com> References: <00123121220605.01056@buffy> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <00123121220605.01056@buffy>; from cliff@raggedclown.net on Sun, Dec 31, 2000 at 09:22:06PM +0100 Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sunday, 31 December 2000 at 21:22:06 +0100, Cliff Sarginson wrote: > Hello, > This may sound like a very silly question... > How can I within a script find out if my dialup PPP internet > connection is up and running or not ? > > There are a lot of untidy ways of doing this, > Is there a cute and bulletproof way ? Well, the obvious thing to do is to look at the status of the link: # ifconfig ppp0 ppp0: flags=8051 mtu 1500 inet 192.109.197.137 --> 139.130.136.129 netmask 0xffffffc0 If it's UP and has two addresses, then you're connected. If you're using user PPP, this will be tun0, not ppp0. Greg -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply. For more information, see http://www.lemis.com/questions.html Finger grog@lemis.com for PGP public key See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message