nginx+keepalive监控nginx脚本

#!/bin/bash
while :
do
nginxpid=`ps -C nginx --no-header | wc -l`
if [ $nginxpid -eq 0 ];then
   /usr/local/nginx/sbin/nginx
   sleep 5
   nginxpid=`ps -C nginx --no-header | wc -l`
   echo $nginxpid
      if [ $nginxpid -eq 0 ];then
       /etc/init.d/keepalived stop
      fi
fi
sleep 5
done


你可能感兴趣的:(nginx,nginx脚本,keepalive监控)