(Q) Running a program if and only if connected
Tom Marshall
tommy at home.tig-grr.com
Mon Sep 23 01:15:25 EST 2002
And divine.
On Sun, Sep 22, 2002 at 08:07:31PM +1000, Tomasz Ciolek wrote:
> have a look at package called whereami.
>
> It can be used to run all manner of programs when the network
> environment chnages to a new one...
>
> ;)
>
>
> On Sun, Sep 22, 2002 at 11:57:15AM +0200, Michael Renzmann wrote:
> > Hi.
> >
> > Timothy Murphy wrote:
> > >I want to run a program on my laptop when I switch on
> > >if and only if it is connected to my desktop.
> > >What is the best way to do this?
> >
> > If your desktop has a static IP address, try the following:
> >
> > ping -c <desktop-ip> > /dev/null && echo "i'm connected to the desktop"
> > || echo "desktop is not there"
> >
> > Only drawback: if the ip is not reachable the above command delays for
> > about 5 seconds.
> >
> > If pinging the ip is not "secure" enough (i.e. if you are sometimes
> > connected to networks where another computer than your desktop has the
> > same ip as your desktop) you could try to work with an arpping on the
> > mac address of your desktop's network interface. arpping is part of the
> > iproute2-package.
> >
> > Bye, Mike
>
> --
> Tomasz M. Ciolek *
> * Everything falls under the law of change;
> <tmc at dreamcraft.com.au> * Like a dream, a phantom, a bubble, a shadow,
> <tmc at goldweb.com.au> * like dew of flash of lightning.
> * You should contemplate like this.
> *******************************************************************************
> GPG Key ID: 0x7A18E49D * Available on www.pgp.net
> *******************************************************************************
--
"We really haven't done everything we could to protect our customers. Our
products just aren't engineered for security."
-- Brian Valentine, Senior Vice President, Microsoft, 9/5/2002
More information about the wireless
mailing list