custom shell script .. OT maybe .
Parv
parv at pair.com
Thu Nov 4 20:46:07 PST 2004
Nothing much for OP...
in message <20041104103013.GA1325 at orion.daedalusnetworks.priv>,
wrote Giorgos Keramidas thusly...
>
> On 2004-11-04 09:26, "Daan Vreeken [PA4DAN]" <Danovitsch at 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
--
More information about the freebsd-questions
mailing list