![]() |
whereami - Automatic Configuration Utility |
whereami can automatically configure the system during boot, whenever a PCMCIA network card is inserted or removed, and whenever there is an APM event. It can:
Since this all happens on PCMCIA card removal or insertion (or whenever else you set it to happen), it should be easy to automate all the actions you would normally take when you arrive at a new location.
I work at quite a variety of places. When I arrive at a new location I find it a pain if it takes me half a morning to get the network set up. Well, I could write scripts to tell my computer where I am, but that's no challenge!
So I like to have my computer automatically know where it is, set the mail relay, DNS forwarder and so forth automatically without me having to worry about it and I can concentrate on getting my job done :-)
Other considerations which have made me design this framework in this way include:
whereami splits the problem of re-configuration into several parts:
My feeling is that there are only a few times when a laptop might find itself in a new 'location': during the boot process, when a PCMCIA (network) card is inserted or removed and after waking up. whereami can run at any or all of these times, after basic hardware initialisation, to detect and configure the more high-level components of the system such as named and sendmail.
By default, whereami is run at boot time and on ifup.
whereami can also be run by the PCMCIA card manager, cardmgr, if the pcmcia-cs package is appropriately set up.
You can also configure whereami to run before APM suspend or after APM resume. This might be useful, for example, for configuring a built-in network adapter when one changes location. You can enable this by editing /etc/whereami/apm.conf.
Location detection is configured by editing /etc/whereami/detect.conf. Here one specifies the unique characteristics of a location that can be discovered by performing tests.
Since version 1.0, whereami allows for one to be at multiple locations at the same time; for example, both 'docked' and 'atwork'.
Go here for full details of setting up location detection in whereami, or read the detect.conf(5) manual page.
Once the current location has been detected, whereami performs actions that are specified for:
For full details of configuration actions, go here, or read the whereami.conf(5) manual page.
Sometimes it is desirable to tell whereami where we are rather than let it try to work it out.
This can be used, e.g., to ensure that network drives are unmounted cleanly before going somewhere else.
To override the location, give the name of the location as an argument to whereami:
whereami <location>
The whereami command accepts other options. Enter:
whereami --help
Since version 0.8, whereami is included in Debian. E-Mail me if you would be interested in using this utility in other distributions, and if you are willing to be a guinea pig for me!
whereami was written by Andrew McMillan, with contributions from various other users, most notably Chris Halls. See the AUTHORS file for full details.
Andrew's Linux Page | 'Whereami' home page | Location Detection | Actions | | © Andrew McMillan, 1999-2002 released under the GPL v2 |