Skip to content

Instantly share code, notes, and snippets.

@Leask
Created July 22, 2013 05:27
Show Gist options
  • Select an option

  • Save Leask/6051470 to your computer and use it in GitHub Desktop.

Select an option

Save Leask/6051470 to your computer and use it in GitHub Desktop.
toggle your Mac's proxy status
#!/bin/sh
# Proxy Switch by LeaskH.com
if [ "`echo 'PUT YOUR PASSWORD HERE' | sudo -S networksetup -getsocksfirewallproxy Wi-Fi | grep '^Enabled'`" = 'Enabled: Yes' ]; then
sudo networksetup -setsocksfirewallproxystate Wi-Fi off
echo 'Turned off!'
else
sudo networksetup -setsocksfirewallproxystate Wi-Fi on
echo 'Turned on!'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment