Skip to content

Instantly share code, notes, and snippets.

@yanyaoer
Created July 8, 2013 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanyaoer/5947397 to your computer and use it in GitHub Desktop.
Save yanyaoer/5947397 to your computer and use it in GitHub Desktop.
network proxy setting on osx
#! /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