Skip to content

Instantly share code, notes, and snippets.

@libook
Created May 1, 2018 07:07
Show Gist options
  • Save libook/4b9ac221267d715b4a0a3b08d8c1d859 to your computer and use it in GitHub Desktop.
Save libook/4b9ac221267d715b4a0a3b08d8c1d859 to your computer and use it in GitHub Desktop.
#!/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