Advertisement
Guest User

Untitled

a guest
May 4th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. URL=$1
  5. GREEN='\033[00;32m'
  6. RED='\033[0;31m'
  7. NC='\033[0m'
  8.  
  9. while true
  10. do
  11. ret=$(curl -I -s "$URL" -o /dev/null -w "%{http_code}|%{remote_ip}\n");
  12. printf "[`date +%T,%3N`] $URL = ";
  13.  
  14. if [ ${ret%\|*} -ne 200 ]; then
  15. printf "${RED}";
  16. else
  17. printf "${GREEN}";
  18. fi
  19.  
  20. printf "${ret%\|*}${NC} ${ret/*\|}\n";
  21. sleep 1;
  22.  
  23. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement