whereami - Network Autoconfiguration Utility


What?

whereami automatically configures your system during boot, whenever a PCMCIA network card is inserted or removed and after waking up from an APM event:

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 manually when you arrive at a new location.


Why?

I sit down to work at quite a variety of places. When I am there I'm generally there for a whole week and its a pain if it takes me half a morning to get the network set up and so on. 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, web 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:


How?

whereami splits the problem of re-configuration into several parts:

Moving from Location to Location

My feeling is that there are only a few actual 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 runs at each of these times, after basic hardware initialisation, to detect and configure the more high-level components of the system such as bind and sendmail.

Suspend and resume

You can configure whereami to run during APM supend/resume. This is useful if you move locations by suspending or hibernating without removing the network card. When you arrive at your new location, you just have to plug the network cable in and wake your laptop up. You can enable this by editing /etc/whereami/apm.conf.

Detection of the Current Location

Location detection is configured through editing /etc/whereami/detect.conf, identifying the unique characteristics which the process will need to examine to decide the current location.

Sinc version 1.0, the location detection in whereami allows for multiple locations to be active at the same time - you could be both 'docked' and 'atwork' together.

Go here for full details of setting up location detection in whereami, or you can use 'man 5 detect.conf' for a comprehensive manual page.

Configuring for the Location

Once the location has been identified whereami builds a location script comprised of actions to execute:

For full details of configuring actions, look here, or you can use 'man 5 whereami.conf' for a comprehensive manual page.

Overriding the Location

Sometimes it is desirable to tell whereami what it's answer should be rather than to have it work things out. This is especially useful for ensuring network drives are unmounted cleanly before going somewhere else. To override the location, use:

      whereami <location>

which will force the new location. For example I often use "whereami undocked" when I am about to disconnect from my current network, to ensure that the nfs drives are unmounted before the network is physically disconnected.

The whereami command also accepts other options: try whereami --help or 'man whereami' for substantialy more information.


Where?

Since version 0.8, whereami is included within the Debian distribution. E-Mail me if you would be interested in seeing this utility in other distributions, and you are willing to be a guinea pig for me!


Who?

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  |   The 'Whereami' Utility  |   Location Detection  |   Configuration Actions  |   © Andrew McMillan, 1999-2002 released under the GPL v2