From owner-freebsd-questions@FreeBSD.ORG Fri Nov 5 04:46:07 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBA2E16A4CE for ; Fri, 5 Nov 2004 04:46:07 +0000 (GMT) Received: from mta11.adelphia.net (mta11.adelphia.net [68.168.78.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 765E243D53 for ; Fri, 5 Nov 2004 04:46:07 +0000 (GMT) (envelope-from parv@chvlva.adelphia.net) Received: from default.chvlva.adelphia.net ([69.160.70.47]) by mta11.adelphia.netESMTP <20041105044606.UBMH2188.mta11.adelphia.net@default.chvlva.adelphia.net>; Thu, 4 Nov 2004 23:46:06 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id 264135A8F; Thu, 4 Nov 2004 23:48:45 -0500 (EST) Date: Thu, 4 Nov 2004 23:48:45 -0500 From: Parv To: Giorgos Keramidas Message-ID: <20041105044845.GA1372@moo.holy.cow> Mail-Followup-To: Giorgos Keramidas , "Daan Vreeken [PA4DAN]" , faisal gillani , freebsd-questions@freebsd.org References: <20041104074244.25031.qmail@web54705.mail.yahoo.com> <200411040926.20167.Danovitsch@Vitsch.net> <20041104103013.GA1325@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041104103013.GA1325@orion.daedalusnetworks.priv> cc: "Daan Vreeken \[PA4DAN\]" cc: faisal gillani cc: freebsd-questions@freebsd.org Subject: Re: custom shell script .. OT maybe . X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Nov 2004 04:46:07 -0000 Nothing much for OP... in message <20041104103013.GA1325@orion.daedalusnetworks.priv>, wrote Giorgos Keramidas thusly... > > On 2004-11-04 09:26, "Daan Vreeken [PA4DAN]" wrote: > > On Thursday 04 November 2004 08:42, faisal gillani wrote: > > > > > > well i want to make a simple/wieard shell script :) which > > > checks somehow connection with the internet & rename some file > > > files if it finds connectivity with the internet , & do > > > nothing of it dont find connectivity with the internet ...is > > > it possible with simple shell script ? or do i have to learn > > > some scripting language for that ? In the long range, learning will be better. > > #!/bin/sh > > > > connection=0 > > ping -c 5 -t 6 some.host.on.the.internet && connection=1 > > Ping may be a bit unreliable at times. If you know the interface > name you can probably get away by using ifconfig to short-cut > through the checks. Problem w/ not actually testing a connection is that there may be an address assigned to the interface (and it would be up) but lacking a meaningful connection, say, courtesy of firewall/dhcp running order/configuration. Well that was my problem w/ ipf & dhcp involving a NIC anyway. - Parv --