小旭 大佬有话说 :
求大佬帮忙写一个shell网站检测脚本
shell访问一个网站获取页面内容指定内容 匹配则网站正常 不匹配则不正常 自动重启服务器
cherbim 大佬有话说 :
curl 网址
llyang 大佬有话说 :
本帖最后由 llyang 于 2020-4-11 18:41 编辑
几行代码就搞定了
:lol
需要具体的,PM我。不口水战:lol
重新启动,只能启动自己的VPS,你不能重新启动别人的VPS哈:Q
榆木 大佬有话说 :
html=$(curl http://www.baidu.com)
findstr="百度"
result=$(echo $html | grep "${findstr}")
if [[ "$result" != "" ]]
then
echo "包含"
else
reboot
fi
不用客气。 33.al/donate
llyang 大佬有话说 :
check=$(curl -L "https://yourdomain.com/aaa.php")
if [[ "$check" =~ "the check content" ]]; then
echo "good"
else
echo "bad"
reboot
fi