Last active
January 26, 2019 13:25
-
-
Save KevinTCoughlin/9688528 to your computer and use it in GitHub Desktop.
Simple bash script to set/unset my common proxy settings.
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/bash | |
set -o nounset | |
set -o errexit | |
HOST="example.com" | |
PORT=8080 | |
if [ $1 == "on" ]; then | |
eval `export http_proxy=http://$HOST:$PORT` | |
eval `npm config set proxy http://$HOST:$PORT` | |
eval `git config --global http.proxy http://$HOST:$PORT` | |
echo Proxy Set | |
else | |
eval `unset http_proxy` | |
eval `npm config delete proxy` | |
eval `git config --global --unset core.gitproxy` | |
echo Proxy Unset | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment