Guest User

Untitled

a guest
Dec 4th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. function proxy-set() {
  2. proxy_enabled=true
  3.  
  4. NO_PROXY_DOMAINS=".abc.com,"
  5. LOCAL_ADDRESSES="localhost"
  6.  
  7. USER=<USER_ID>
  8. PASSWORD=<URL_ENCODED_PASSWORD>
  9. SERVER=httppxgot.abc.com
  10. PORT=8080
  11.  
  12. if [[ "${proxy_enabled}" = "true" ]]; then
  13. export http_proxy="http://${USER}:${PASSWORD}@${SERVER}:${PORT}"
  14. export HTTP_PROXY="http://${USER}:${PASSWORD}@${SERVER}:${PORT}"
  15. export https_proxy="http://${USER}:${PASSWORD}@${SERVER}:${PORT}"
  16. export HTTPS_PROXY="http://${USER}:${PASSWORD}@${SERVER}:${PORT}"
  17. export no_proxy="${LOCAL_ADDRESSES},${NO_PROXY_DOMAINS}"
  18. export NO_PROXY="${LOCAL_ADDRESSES},${NO_PROXY_DOMAINS}"
  19. fi
  20. echo 'Im set!'
  21. }
  22. # Disable HTTP proxy (when working from outside office for instance)
  23. function proxy-unset() {
  24. unset http_proxy
  25. unset HTTP_PROXY
  26. unset https_proxy
  27. unset HTTPS_PROXY
  28. unset no_proxy
  29. unset NO_PROXY
  30. echo 'Im unset!'
  31. }
  32.  
  33. syntax error near unexpected token `newline'
  34. -bash: /cygdrive/c/Users/XXX/.bashrc: line 214: ` USER=<USER_ID>'
Add Comment
Please, Sign In to add comment