Sunday, June 14, 2015

Quickly Turns On/Off SOCKS Proxy for MacOS X

#!/bin/bash

case "$1" in
  'on'|'off')
    networksetup -setsocksfirewallproxystate Wi-Fi $1
    networksetup -setsocksfirewallproxystate Ethernet $1
    ;;
  *)
    echo "Usage: sudo $0 on|off"
    exit
    ;;
esac

networksetup -getsocksfirewallproxy Wi-Fi
networksetup -getsocksfirewallproxy Ethernet

No comments: