shell判断web服务期是否正常

前端之家收集整理的这篇文章主要介绍了shell判断web服务期是否正常前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. #如下,对一个网页进行简单的判断,看是否正常
  2. #!/bin/bash
  3.  
  4. fail=0
  5. #success=0
  6.  
  7. while((fail<=2))
  8. do
  9. wget--timeout=5--tries=1http://oldboy.blog.51cto.com-q-O/dev/null#timeout定义超时时间--tries定义尝试次数
  10. a=$?
  11. if[$a-ne0]
  12. then
  13. letfail=fail+1
  14. else
  15. echo"success"
  16. exit0
  17. fi
  18. done
  19.  
  20. echo"thisisafailadress"

猜你在找的Bash相关文章