Last active
May 18, 2018 09:19
-
-
Save dlemmon/e5649259cb4ffa230f3e83ae93f19044 to your computer and use it in GitHub Desktop.
Set proxy variables from bash when you don't want to have the password hardcoded, or in a command history. Works in windows with git bash
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 | |
[[ $_ != $0 ]] && echo "Write your password:" || | |
echo "You need to call this from the source command: source $(basename $0)" | |
PROTOCOL=http | |
USERNAME=myuser | |
HOST=proxy.bigevilcorporation.com | |
PORT=8009 | |
read -s PASS | |
export http_proxy=$PROTOCOL://$USERNAME:$PASS@$HOST:$PORT | |
export https_proxy=$http_proxy | |
export HTTP_PROXY=$http_proxy | |
export HTTPS_PROXY=$http_proxy | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment