Mac OS X

Mac OS X: Changing Locations from the CLI

The scselect command only does one thing.  Open up your System Preferences and click on the Network System Preference pane.  Create a new location called test and then put your system back to the old location (obviously don’t do crap like this on a production server or anything like that).  Now fire up Terminal and type the following command:

scselect test

Provided your location was called test you should see your Network System Preference pane update immediately with the new information.  Now let’s say that you wanted to defer the new location to become active until you reboot next.  Apple included the one and only option for scselect as the ability to defer activation of a location to reboot rather than do it immediately.

Changing locations is a fairly elegant way to go about testing and scripting for network events at times.  Now you have a way to do so within your scripts.