Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jan 2001 14:35:09 +1030
From:      Greg Lehey <grog@lemis.com>
To:        Cliff Sarginson <cliff@raggedclown.net>
Cc:        questions@freebsd.org
Subject:   Re: Last question this year. Am I connected ?
Message-ID:  <20010101143509.D44043@wantadilla.lemis.com>
In-Reply-To: <00123121220605.01056@buffy>; from cliff@raggedclown.net on Sun, Dec 31, 2000 at 09:22:06PM %2B0100
References:  <00123121220605.01056@buffy>

next in thread | previous in thread | raw e-mail | index | archive | help
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<UP,POINTOPOINT,RUNNING,MULTICAST> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010101143509.D44043>