proxy.zsh 703 B

12345678910111213141516
  1. #
  2. # Proxy settings
  3. # Thanks to:
  4. # https://github.com/dangerous/dotfiles
  5. #
  6. # TODO: The setting of the IP should be perhaps moved to a zshlocal file.
  7. 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;'
  8. 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;'
  9. # run only if I am at work
  10. if [ `ifconfig | grep 10.10.0 | wc -l` = 1 ]; then
  11. proxy
  12. fi
  13. if [ `ifconfig | grep 192.168.2 | wc -l` = 1 ]; then
  14. proxy
  15. fi