Skip to main content

I'm looking at some scenarios where it would be nice to have a script ran when certain network or local drives are mounted or unmounted. Has anyone done something like this? If so, how? I'm not quite sure where to start.

One place to start would be to look at a LaunchAgent (these run in the user space) that would use the StartOnMount key. This triggers the LaunchAgent to run whatever script or processes you specify whenever the OS sees a share get mounted.