Is there a hook or trigger I can use to run a script when a new network connection is made? I have a 2014 retina Macbook Pro running Yosemite (10.10.3). I would like to run a script whenever a certain network interface is connected. Is there a hook or trigger I can use? I have a shell script that will perform the actions I want to perform, I just need to know how to trigger it.
There's a great utility called ControlPlane that allows you to trigger all kinds of events based on the context of system rules you set.

from the about page on the site: http://www.controlplaneapp.com  


  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.