Kill a Program on Connecting to a specific WiFi – OSX

Hi folks. If you have the tendency, like me, to forget that you are on the corporate VPN, or leave a certain software open when you bring your laptop to work, this might be helpful to you too. It’s a small script which kills a program when you change your Wifi network. Script: #!/bin/bash function log { directory="/Users/<username>/wifi_detect" log_dir_exists=true if [ ! -d $directory ]; then echo "Attempting to create => $directory" mkdir -p $directory if [ !...

October 26, 2015 · 2 min · hannibal