检测网站down掉后自动发信的shell脚本代码
更新时间:2013年02月25日 15:14:15 作者:
脚本用途:检测指定文件中的网站url,当一个网站down掉后,自动给指定的邮箱发信
复制代码 代码如下:
#!/bin/bash
#website test scripts
while true;do
for cycle_temp in `cat url_list`
do
if lynx -dump `echo ${cycle_temp}` -accept_all_cookies|grep "true";then
echo "The website is running naturally"
else
echo "${cycle_temp} has been offline please attend it now!">/opt/test.txt
mail -v -s "website down mail" reterry123@163.com < /opt/test.txt
fi
done
sleep 2s
done
相关文章
shell脚本学习指南[五](Arnold Robbins & Nelson H
这篇文章主要介绍了shell脚本学习指南[五](Arnold Robbins & Nelson H.F. Beebe著),需要的朋友可以参考下2014-02-02


最新评论