Advertisement
Guest User

proxyfy.sh

a guest
Mar 8th, 2019
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  assignProxy(){
  4.    PROXY_ENV="http_proxy ftp_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY ALL_PROXY"
  5.    for envar in $PROXY_ENV
  6.    do
  7.      export $envar=$1
  8.    done
  9.    for envar in "no_proxy NO_PROXY"
  10.    do
  11.       export $envar=$2
  12.    done
  13.  }
  14.  
  15.  clrProxy(){
  16.    assignProxy "" # This is what 'unset' does.
  17.  }
  18.  
  19.  proxyfy(){
  20.    user=EscapeOrQuoteThePassword
  21.    pass="Curious, aren't you?"
  22. #   read -p "Password: " -s pass &&  echo -e " "
  23.    proxy_value="http://$user:$pass@lelaporm.telecomitalia.local:8080"
  24.    no_proxy_value="localhost,127.0.0.1"
  25.    assignProxy $proxy_value $no_proxy_value
  26.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement