Laptop Events to hook with scripts?
I'm looking for info on customizing my linux networking
presence. I have an hp Omnibook 4150 with a docking station.
Additionally my machine is commonly on the network as two different
hostnames. And finally, my docking station is using a PCI lan card
but while undocked I'm using a PCMCIA Xircom/Modem card.
So I support currently four configurations:
(1) docked, pci-lan card, as hostname1
(2) undocked, no lan cards (use dummy i/f)
(3) undocked, Xircom card, as hostname2 (more often)
(4) undocked, Xircom card, as hostname1 (less often)
Notice i havn't even tried the modem to ISP, yet ;-)
I've discovered a number of things that need attention when
transitioning between these four states:
- pcmcia at two hostnames can probably be handled with
with schemes. (today I simply swap the network.opts file:
- dwww needs it's config adjusted:
- kde has a lease three config files that want to change.
(krnrc, kmailrc, kwmrc)
- There's our hostname file:
- And there are various other network files:
(/etc/init.d/network, /etc/network/interfaces, /etc/networks)
For now switching involves running a script to swap out these files
when I change configurations.
What I think I'm looking for is a way to catch the docking/undocking
state changes and run the appropriate scripts (which may even prompt
me for which undocked network config I desire).
To complete the set I think I'd also want the card insertion
to prompt me for my networking choice.
None of these are hard, if the events to hook exist. The question
to this readership is twofold:
(1) Is there a package or at least the beginnings
of a standard way to handle these things?
(2) Do these events exist in some form so we can hook
them and run our scripts?
Looking forward to any help you can offer. And Thanks for taking the
time to respond!
Stephen M Moraco