Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kgriffs
Last active August 29, 2015 14:07
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 kgriffs/cc09b1db157a7f989154 to your computer and use it in GitHub Desktop.
Save kgriffs/cc09b1db157a7f989154 to your computer and use it in GitHub Desktop.
Max OS X - Toggle SOCKS Proxy
#!/usr/bin/env bash
STATUS=`networksetup -getsocksfirewallproxy USB\ Ethernet | sed -n 1p`
if test "$STATUS" = "Enabled: No"
then
echo "Enabling..."
NEW_SETTING="on"
else
echo "Disabling..."
NEW_SETTING="off"
fi
`networksetup -setsocksfirewallproxystate USB\ Ethernet $NEW_SETTING`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment