检测网站是否存活
2019-11-02 10:53 丿莫*莉 阅读(111) 评论(0) 收藏 举报#!/bin/bash
. /etc/init.d/functions
check_fun(){
url_list=(www.baido.com www.youku.com www.sdx3.com)
for i in ${url_list[@]}
do
curl -s -o /dev/null http://$i
if [ $? -eq 0 ]; then
action "$i" /bin/true
else
action "$i" /bin/false
fi
done
}
while :
do
check_fun
sleep 3
done
浙公网安备 33010602011771号