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

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

检测网站down掉后自动发信的shell脚本代码 复制代码 代码如下:
#!/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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/3346113.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-10-06
下一篇 2022-10-06

发表评论

登录后才能评论

评论列表(0条)

保存