检测nginx是否正常,如果不正常则自动重启
#!/bin/bash
nginx=`netstat -tnlp | grep 80 | grep nginx | wc -l`
if [ "$nginx" -gt 0 ];then
echo "Nginx is running..."
else
echo "Nginx is stopped"
/application/nginx/sbin/nginx
fi
本文转自激情燃烧的岁月博客51CTO博客,原文链接http://blog.51cto.com/liuzhengwei521/1771500如需转载请自行联系原作者
weilovepan520