-
-
Save sabman/302427 to your computer and use it in GitHub Desktop.
git clone from behind a proxy
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/bash | |
repo_url=$1 | |
read -s -p "Enter Password: " password | |
echo "Saving original proxy ... " | |
orig_proxy=$HTTP_PROXY | |
echo "getting username: $USERNAME" | |
echo "seeding the proxy with sweet love ..." | |
echo -ne '##### (33%)\r' | |
sleep 1 | |
echo -ne '############# (66%)\r' | |
sleep 1 | |
echo -ne '####################### (100%)\r' | |
echo -ne '\n' | |
HTTP_PROXY=`echo -n $HTTP_PROXY | sed -e "s/http:\/\/\(.*\)/http:\/\/$USERNAME:$password@\1/"` | |
git clone $1 | |
#removing the love from the proxy | |
HTTP_PROXY=$orig_proxy | |
echo $HTTP_PROXY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment