Last active
August 29, 2015 14:11
-
-
Save yanyaoer/078954b416400a71c9c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome work!