From owner-freebsd-questions Sat Sep 19 14:21:54 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA27634 for freebsd-questions-outgoing; Sat, 19 Sep 1998 14:21:54 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA27621 for ; Sat, 19 Sep 1998 14:21:41 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from ben by scientia.demon.co.uk with local (Exim 2.03 #1) id 0zKTcg-0002nv-00; Sat, 19 Sep 1998 21:28:50 +0100 Date: Sat, 19 Sep 1998 21:28:49 +0100 From: Ben Smithurst To: francisco@natserv.com, questions@FreeBSD.ORG Subject: Re: How to tell if connected to internet? Message-ID: <19980919212849.A10391@scientia.demon.co.uk> References: <199809191720.NAA14305@federation.addy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <199809191720.NAA14305@federation.addy.com> User-Agent: Mutt/0.94.3i (FreeBSD 3.0-CURRENT i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Francisco Reyes wrote: > What command can I use to tell if I am connected to the internet? > I found "show ipcp" in ppp, but I am looking for something that would > either return 0/1 or that I could call on shell script and parse the > status. Put in ppp.linkup: !bg touch /tmp/ppp-online Put in ppp.linkdown !bg rm -f /tmp/ppp-online Then, to check if you are online $ test -f /tmp/ppp-online There may be better ways, but this seems fairly reliable and simple to check from a shell script. -- Ben Smithurst : ben@scientia.demon.co.uk : http://www.scientia.demon.co.uk/ PGP: 0x99392F7D - 3D 89 87 42 CE CA 93 4C 68 32 0E D5 36 05 3D 16 http://www.scientia.demon.co.uk/ben/pgp-key.html (or use keyservers) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message