Created
September 29, 2012 20:05
-
-
Save georgebrock/3805062 to your computer and use it in GitHub Desktop.
OS X SOCKS proxy script
This file contains 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
#!/usr/bin/env bash | |
# The name of the wireless network has changed between versions of OS X, so we | |
# need to find the right name: | |
service=`networksetup -listallnetworkservices | grep -Ei 'wi-fi|airport'` | |
networksetup -setsocksfirewallproxy $service localhost 9000 | |
networksetup -setsocksfirewallproxystate $service on | |
echo 'Connecting to proxy.' | |
echo 'Press ctrl+c when you are done.' | |
ssh -ND 9000 myserver.example.com | |
echo 'Disconnecting.' | |
networksetup -setsocksfirewallproxystate $service off |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment