Guest User

Untitled

a guest
Jul 11th, 2018
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #!/bin/bash
  2. proxy_targets="http://10.1.1.4:3128 http://10.1.1.5:3128 http://10.1.1.6:3128"
  3.  
  4. failed_hosts=""
  5.  
  6. for i in $proxy_targets
  7. do
  8.  
  9. if http --check-status --ignore-stdin --timeout=2.5 --proxy=http:$i HEAD www.msftncsi.com/ncsi.txt &> /dev/null; then
  10. echo 'OK!'
  11. else
  12. case $? in
  13. 2) echo 'Request timed out!'| mail -s "The following WSA has failed to pass traffic with the following error" moe.abdel@childrens.ha
  14. rvard.edu ;;
  15. 3) echo 'Unexpected HTTP 3xx Redirection!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
  16. 4) echo 'HTTP 4xx Client Error!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
  17. 5) echo 'HTTP 5xx Server Error!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
  18. 6) echo 'Exceeded --max-redirects=<n> redirects!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
  19. *) echo 'Other Error!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
  20. esac
  21. fi
  22. done;
Add Comment
Please, Sign In to add comment