[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to manager different network environments?

On Sun, Nov 03, 2002 at 09:57:15PM +0100, Mariano Kamp wrote:
> > Hmmmm...  It should do that too, I guess, but I don't think that pcmcia
> > has any hooks to trigger things on removal.
> > 
> > I will look into it.
> Unfortunately I don't have a clue about scripts yet. I tried to copy the
> hook for whereami from the start section of the network script to the
> stop section, but without much success. Whereami is called then, but
> unfortunately before the removal of the wlan modules, so that whereami
> still detects them.

You could try using the --hint option to pass a location to whereami.
For example:

 - call whereami from pcmcia exit with --hint pcmcia_stop

 - in detect.conf:

if pcmcia_stop
  testmodlue wlan_cs wlan

That should prevent the wlan location from being set if in the stop hook.
The arrangement would have to be a little more complicated if you have more
than one pcmcia card (maybe add a second hint which is the name of the card
to the whereami hook?)

> > >  On lwe I've seen on Chris' laptop, that whereami was triggered when he
> > > plugged the ethernet cable?! How is that to be accomplished?
> > 
> > That's tricky!   I know there is a daemon in laptop-net that monitors
> > the mii status for cable insertion.  I have been thinking of merging
> > some of that into whereami, but only discovered it last week.
> > 
> > Not sure what Chris is doing - perhaps he could elucidate!

Erm, sorry I must have tricked you into thinking that happened
automatically :) but that isn't the case :( . If I remember correctly, I typed
'whereami' after unplugging/plugging the cable in to trigger the detection
and showed you the output on screen (or maybe that was someone else).

There are hooks into apm (see /etc/whereami/apm.conf) so that you can run
whereami when the machine wakes up.  I always make sure that the network
cable is plugged in before I wake the machine up; if I forget and plug in
the cable afterwards I run whereami manually.


Attachment: pgpY3jLXkQZ2J.pgp
Description: PGP signature

Reply to: