10.4: Set 'Location' automatically via a script

Jan 27, '06 05:33:00AM

Contributed by: Anonymous

Tiger only hintIf you want to set your Mac OS X Location automatically (based on Airport name (SSID) or something else), have a look at this script and launchd item.

Basically, it creates a launchd item that listens for changes in the /Library -> Preferences -> SystemConfiguration directory. And it happens that this directory gets changed every time the network changes. When a change is noticed, a script launches that figures out the SSID and IP addresses, and from there sets the Location based on some rules.

Because the script is simply a bash script, you can make it do lots of stuff based on your current location

[robg adds: I haven't tested this one...]

Comments (15)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060122060330816