A=`ps -C nginx -no-header | wc - 1`
if [ $A -eq 0];then                    #如果Nginx服务不存在
  /usr/local/nginx/sbin/nginx  #启动Nginx
  sleep 2
  if [`ps -C nginx --no-header| wc -1` -eq 0 ];then
    #如果Nginx启动失败，终止Keepalived 
    killall keepalived                
  fi
fi
