Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Nov 2004 23:48:45 -0500
From:      Parv <parv@pair.com>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: custom shell script .. OT maybe .
Message-ID:  <20041105044845.GA1372@moo.holy.cow>
In-Reply-To: <20041104103013.GA1325@orion.daedalusnetworks.priv>
References:  <20041104074244.25031.qmail@web54705.mail.yahoo.com> <200411040926.20167.Danovitsch@Vitsch.net> <20041104103013.GA1325@orion.daedalusnetworks.priv>

next in thread | previous in thread | raw e-mail | index | archive | help
Nothing much for OP...

in message <20041104103013.GA1325@orion.daedalusnetworks.priv>,
wrote Giorgos Keramidas thusly...
>
> On 2004-11-04 09:26, "Daan Vreeken [PA4DAN]" <Danovitsch@Vitsch.net> 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

-- 



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