Skip to content

Instantly share code, notes, and snippets.

@yanyaoer
Last active August 29, 2015 14:11
Show Gist options
  • Save yanyaoer/078954b416400a71c9c8 to your computer and use it in GitHub Desktop.
Save yanyaoer/078954b416400a71c9c8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# $ brew install sleepwatcher
# $ launchctl load ~/Library/LaunchAgents/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
# move this script to $HOME/.wakeup
SSID=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I\
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' ')
home_ssid='YOURHOME_SSID'
office_ssid='YOUROFFICE_SSID'
case $SSID in
$office_ssid* ) state="on";;
$home_ssid* ) state="off";;
esac
# set network proxystate with *man networksetup*
# eg. sudo networksetup -setautoproxystate Wi-Fi $state
@geekan
Copy link

geekan commented Dec 19, 2014

awesome work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment