Skip to content

Instantly share code, notes, and snippets.

@jalexanderfox
Last active December 15, 2015 15:49
Show Gist options
  • Save jalexanderfox/df6016f35f1eb65951f1 to your computer and use it in GitHub Desktop.
Save jalexanderfox/df6016f35f1eb65951f1 to your computer and use it in GitHub Desktop.

Revisions

  1. jalexanderfox revised this gist Dec 15, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions templateProxy.sh
    Original file line number Diff line number Diff line change
    @@ -29,8 +29,8 @@
    no_proxy_value="localhost,127.0.0.1,LocalAddress,LocalDomain.com"
    assignProxy $http_proxy_value $https_proxy_value $no_proxy_value

    git config --global http.proxy $http_proxy_value
    git config --global https.proxy $https_proxy_value
    # git config --global http.proxy $http_proxy_value
    # git config --global https.proxy $https_proxy_value
    }

    startProxy(){
  2. jalexanderfox revised this gist Dec 14, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions templateProxy.sh
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@
    git config --global --unset https.proxy
    }

    startProxy(){
    initProxy(){
    http_proxy_value="http://$1:$2@$3:$4"
    https_proxy_value="https://$1:$2@$3:$4"
    no_proxy_value="localhost,127.0.0.1,LocalAddress,LocalDomain.com"
    @@ -33,11 +33,11 @@
    git config --global https.proxy $https_proxy_value
    }

    initProxy(){
    startProxy(){
    read -p "Username: " -s user
    read -p "Password: " -s pass && echo -e " "
    domain=!PROXYDOMAIN!
    port=!PROXYPORT!

    startProxy $user $pass $domain $port
    initProxy $user $pass $domain $port
    }
  3. jalexanderfox revised this gist Dec 14, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion templateProxy.sh
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@
    git config --global https.proxy $https_proxy_value
    }

    startProxy(){
    initProxy(){
    read -p "Username: " -s user
    read -p "Password: " -s pass && echo -e " "
    domain=!PROXYDOMAIN!
  4. jalexanderfox created this gist Dec 14, 2015.
    43 changes: 43 additions & 0 deletions templateProxy.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    #!/bin/bash

    assignProxy(){
    HTTP_PROXY_ENV="http_proxy ftp_proxy all_proxy HTTP_PROXY FTP_PROXY ALL_PROXY"
    HTTPS_PROXY_ENV="https_proxy HTTPS_PROXY"
    for envar in $HTTP_PROXY_ENV
    do
    export $envar=$1
    done
    for envar in $HTTPS_PROXY_ENV
    do
    export $envar=$2
    done
    for envar in "no_proxy NO_PROXY"
    do
    export $envar=$3
    done
    }

    stopProxy(){
    assignProxy ""
    git config --global --unset http.proxy
    git config --global --unset https.proxy
    }

    startProxy(){
    http_proxy_value="http://$1:$2@$3:$4"
    https_proxy_value="https://$1:$2@$3:$4"
    no_proxy_value="localhost,127.0.0.1,LocalAddress,LocalDomain.com"
    assignProxy $http_proxy_value $https_proxy_value $no_proxy_value

    git config --global http.proxy $http_proxy_value
    git config --global https.proxy $https_proxy_value
    }

    startProxy(){
    read -p "Username: " -s user
    read -p "Password: " -s pass && echo -e " "
    domain=!PROXYDOMAIN!
    port=!PROXYPORT!

    startProxy $user $pass $domain $port
    }