检查网站状态码

Posted on Posted in bash

> code

  1. CheckURL="http://www.baidu.com"  
  2. STATUS_CODE=`curl -o /dev/null -m 10 --connect-timeout 10 -s -w %{http_code} $CheckURL`  
  3. if [ "$STATUS_CODE" = "200" ];then  
  4. echo "ok"  
  5. fi  
» 转载请注明来源:若我若鱼 » 检查网站状态码

Leave a Reply

Your email address will not be published. Required fields are marked *

2 × two =