~5 years ago an enthusiastic coworker was telling me about some awesome app that would do stuff like automatically change your volume, mount network drives, launch apps, etc. when it notices that your location (I guess defined by network IP address) has changed. I was sort of "meh" and ignored him. Now I wish I had that app, but my google searches are not turning up anything.
Try this app
Sidekick, a new app by Oomph, aims at automating the tedious process of changing your Mac's settings basing on the location of your computer.
Besides managing and switching places, Sidekick can assign actions to places. Actions can indicate anything from changing a specific option (example: turn Bluetooth on/off) to a more complex set of commands (connect to a server then run a shell script). The app is highly customizable in that it lets you control how a place is recognized on the list, what should happen, and in which order, as soon as the place is "active" and your Mac is ready to get to work.
What does Sidekick do? Sidekick has the power to auto-adjust various laptop system preferences and application settings. Here are just a few of the things that Sidekick can control:
Open and close applications Change the Default Printer Connect to Server And much more...
ControlPlane is a context-aware application that lets you do all kinds of things based on where you computer happens to be. Move from home to the coffeehouse and ControlPlane can switch your computer to high security mode.
ControlPlane allows you to build configuration profiles, contexts in ControlPlane lingo, for your Mac based on where you are or what you are doing. ControlPlane determines where you are or what you are doing based on a number of available evidence sources and then automatically reconfigures your Mac based on your preferences. Evidence sources can include your current location, visible WiFi networks, attached USB devices, running applications and more. You can even write your own evidence sources using shell scripts!
There's a long list of things ControlPlane can do for you and it includes the things you're asking for. ControlPlane is based of the MarcoPolo project, which is no longer actively under development.
And: it's free.