dustinrue / ControlPlane

ControlPlane - context-sensitive computing for OS X
http://www.controlplaneapp.com
BSD 3-Clause "New" or "Revised" License
1.76k stars 180 forks source link

Can "Changing Network Location" be added to the Evidence Sources? #412

Open Panja0 opened 9 years ago

Panja0 commented 9 years ago

System Preferences --> Network --> Location(s)

Is that possible? For me it would be very handy.

I have setup multiple network locations with different DNS servers. When changing a network location, I manually run a script to flush my dns cache. It would be nice if this can be automated with ControlPlane. So when I change a network location, ControlPlane runs a shell script to flush the dns.

Cheers

hyei commented 8 years ago

I had a similar need. With 1.6.4,

  1. Setup a context for each network location
  2. Create a Shellscript action on arrival with each context to run a configuration shell script.
  3. Create a Network Location action to change to for each context.

The bonus is don't have to dig into the System Preferences to change location, and just use ControlPlane system applet to change network locations.

dustinrue commented 8 years ago

Changing the network location, specifically, doesn't work very well if you're keying contexts off of any network based evidence sources. It causes ControlPlane to flop back and forth between contexts.

hyei commented 8 years ago

That's why I change context manually, and it changes network location settings for me. I could not figure out have to change contexts based the location changing reliably (or at all).