检测网站down掉后自动发信的shell脚本代码
检测网站down掉后自动发信的shell脚本代码
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:#!/bin/bash#websitetestscriptswhiletrue;doforcycle_tempin`cat...

复制代码 代码如下:

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

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新linuxshell学习
热门linuxshell学习
脚本专栏子分类