Created
November 19, 2018 16:57
-
-
Save KhasMek/748d04b3a7398fefc8771d054fd28d68 to your computer and use it in GitHub Desktop.
quick plugin for omz to (un)set shell proxies. Pretty rough atm.
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
#!/bin/zsh | |
# | |
# Sets and unsets a proxy address/port for the local shell | |
# | |
function enable_shell_proxy() { | |
if [[ -n "$1" ]]; then | |
proxy="$1" | |
else; | |
proxy="127.0.0.1:8080" | |
fi | |
echo "Proxy Server: $proxy" | |
export http_proxy="http://$proxy" | |
export https_proxy="https://$proxy" | |
echo " [*] Proxy servers set!" | |
echo " [*] HTTP Proxy: $http_proxy" | |
echo " [*] HTTP Proxy: $https_proxy" | |
} | |
function disable_shell_proxy { | |
unset http_proxy | |
unset https_proxy | |
echo " [*] Proxy servers unset!" | |
echo " [*] HTTP Proxy: $http_proxy" | |
echo " [*] HTTP Proxy: $https_proxy" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment