判断url地址是否正确 脚本

#!/bin/bash
.  /etc/init.d/functions
check_fun(){
url_list=(www.baidu.com www.tudou.com www.youku.com www.xxx22sfq2.com www.asdqwe.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
        for j in `seq 1 3`
        do
                check_fun
                sleep 3
                continue
        done
        break
done
原文地址:https://www.cnblogs.com/xianglei_/p/12165490.html