proxy.zsh 629 B

123456789101112131415
  1. #
  2. # Proxy settings
  3. # Thanks to:
  4. # https://github.com/dangerous/dotfiles
  5. #
  6. alias proxy='export http_proxy=http://192.168.1.248:3128;export HTTP_PROXY=$http_proxy;export https_proxy=$http_proxy;export HTTPS_PROXY=$http_proxy;export ftp_proxy=$http_proxy;export FTP_PROXY=$http_proxy;'
  7. alias noproxy='export http_proxy='';export HTTP_PROXY=$http_proxy;export https_proxy=$http_proxy;export HTTPS_PROXY=$http_proxy;export ftp_proxy=$http_proxy;export FTP_PROXY=$http_proxy;'
  8. # run only if I am at work
  9. if [ `ifconfig | grep 10.10.0 | wc -l` = 1 ]; then
  10. proxy
  11. fi
  12. if [ `ifconfig | grep 192.168.2 | wc -l` = 1 ]; then
  13. proxy
  14. fi