Advertisement
opexxx

proxy.sh

Apr 17th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.32 KB | None | 0 0
  1. function proxy () {
  2. UNSET=""
  3. PROXY="http://127.0.0.1:8080"
  4. PROXY_ENV=(http_proxy https_proxy ftp_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY)
  5. if [ $1 == on ]; then
  6. for i in $PROXY_ENV; do
  7. export $i=$PROXY
  8. done
  9. echo "proxy set"
  10. elif [ $1 == off ]; then
  11. for i in $PORXY_ENV; do
  12. unset $i
  13. done
  14. echo "proxy unset"
  15. fi
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement