作者:老陈 | 来源:互联网 | 2023-08-16 12:01
原标题:检测网站down掉后自动发信的shell脚本代码
代码如下:
#!/bin/bash
#website test scripts
while true;do
for cycle_temp in `cat url_list`
do
if lynx -dump `echo ${cycle_temp}`文章来源地址73408.html -accwww.yii666.comept_all_COOKIEs|grep "true";then
echo "The website is running naturally"
else
echo "${cycle_temp} 文章来源站点https://www.yii666.com/has been offline please attend 文章来源地址73408.htmlit now!">/opt/test.txt
mail -v -s "website downwww.yii666.com mail" reterry123@163.com fi
done
sleep 2s
done
来源于:检测网站down掉后自动发信的shell脚本代码