判断网址是否可用
#!/bin/bash . /etc/init.d/functions check_fun(){ url_list=(www.baidu.com www.tudou.com www.youku.com www.xxx222.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