首页 > Web开发 > 详细

检测网站down掉后自动发信的shell脚本代码

时间:2016-01-22 01:43:56      阅读:245      评论:0      收藏:0      [点我收藏+]
复制代码 代码如下:

#!/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

检测网站down掉后自动发信的shell脚本代码

原文:http://www.jb51.net/article/34252.htm

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!