Advertisement
Guest User

Untitled

a guest
Sep 5th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. if [ $(id -u) -ne 0 ]; then
  2. echo "This script must be run as root";
  3. exit 1;
  4. fi
  5.  
  6. if [ $# -eq 4 ] then
  7.  
  8. gsettings set org.gnome.system.proxy mode 'manual' ;
  9. gsettings set org.gnome.system.proxy.http host '$1';
  10. gsettings set org.gnome.system.proxy.http port $2;
  11. gsettings set org.gnome.system.proxy.http authentication-user '$3';
  12. gsettings set org.gnome.system.proxy.http authentication-password '$4';
  13.  
  14.  
  15. grep PATH /etc/environment > lol.t;
  16. printf
  17. "http_proxy=http://$3:$4@$1:$2/n
  18. https_proxy=http://$3:$4@$1:$2/n
  19. ftp_proxy=http://$3:$4@$1:$2/n
  20. no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"n
  21. HTTP_PROXY=http://$3:$4@$1:$2/n
  22. HTTPS_PROXY=http://$3:$4@$1:$2/n
  23. FTP_PROXY=http://$3:$4@$1:$2/n
  24. NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"n" >> lol.t;
  25.  
  26. cat lol.t > /etc/environment;
  27.  
  28.  
  29. printf
  30. "Acquire::http::proxy "http://$3:$4@$1:$2/";n
  31. Acquire::ftp::proxy "ftp://$3:$4@$1:$2/";n
  32. Acquire::https::proxy "https://$3:$4@$1:$2/";n" > /etc/apt/apt.conf.d/95proxies;
  33.  
  34. rm -rf lol.t;
  35.  
  36. else
  37.  
  38. printf "Usage $0 <proxy_ip> <proxy_port> <username> <password>n";
  39.  
  40. fi
  41.  
  42. Acquire::http::proxy "http://username:password@host:port/";
  43. Acquire::ftp::proxy "ftp://username:password@host:port/";
  44. Acquire::https::proxy "https://username:password@host:port/";
  45.  
  46. http_proxy=http://username:password@host:port/
  47. ftp_proxy=ftp://username:password@host:port/
  48. https_proxy=https://username:password@host:port/
  49.  
  50. http_proxy = http://proxy:port/
  51. https_proxy = http://proxy:port/
  52. proxy_user = user
  53. proxy_password = password
  54. use_proxy = on
  55. wait = 15
  56.  
  57. npm config set proxy $HTTP_PROXY
  58. npm config set https-proxy $HTTPS_PROXY
  59. npm config set strict-ssl false
  60. echo "proxy = $HTTP_PROXY" > ~/.curlrc
  61. echo "noproxy = $NO_PROXY" >> ~/.curlrc
  62. git config --global http.proxy $HTTP_PROXY
  63. git config --global https.proxy $HTTPS_PROXY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement