Created
May 1, 2018 07:07
-
-
Save libook/4b9ac221267d715b4a0a3b08d8c1d859 to your computer and use it in GitHub Desktop.
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
#!/bin/zsh | |
# Switcher of shell proxy. | |
# Shell proxy | |
function shell-proxy(){ | |
if [ "$1" = "on" ]; then | |
echo "Turning on shell proxy..." | |
export ALL_PROXY=socks5://127.0.0.1:1080 | |
elif [ "$1" = "off" ]; then | |
echo "Turning off shell proxy..." | |
unset ALL_PROXY | |
else | |
echo "Please use command 'shell-proxy on' or 'shell-proxy off'." | |
fi | |
curl ip.cn | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment