-
-
Save happypeter/c2a2b4969bbfe92ffb82 to your computer and use it in GitHub Desktop.
byebye GFW
This file contains hidden or 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
cleanup() | |
# example cleanup function | |
{ | |
networksetup -setsocksfirewallproxystate wi-fi off | |
} | |
control_c() | |
# run if user hits control-c | |
{ | |
echo -en "\n*** Ouch! Closing proxy ***\n" | |
cleanup | |
exit $? | |
} | |
# trap keyboard interrupt (control-c) | |
trap control_c SIGINT | |
echo "Turning on proxy" | |
networksetup -setsocksfirewallproxystate wi-fi on | |
# main() loop | |
ssh -N -D 7070 106.186.22.51 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment