Created
July 8, 2013 09:16
-
-
Save yanyaoer/5947397 to your computer and use it in GitHub Desktop.
network proxy setting on osx
This file contains hidden or 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 | |
state=$(networksetup -getsocksfirewallproxy Wi-Fi | grep ^Enabled: | cut -d : -f 2,2) | |
if [ $state == Yes ] | |
then | |
cmd=off | |
else | |
cmd=on | |
fi | |
sudo networksetup -setsocksfirewallproxystate Wi-Fi $cmd | |
echo $cmd # send notification center by alfred |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment