#!/bin/bash
#FileName:Nginx_check.sh

while  :
do
nginxpid=$(ps -C nginx --no-header | wc -l)
 if [ $nginxpid -eq 0 ];then
  /data/server/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
