标签:sleep
加入nginx宕了,keepalive也跟着自杀
#!/bin/bash
while :
do
nginxpid=`ps -C nginx --no-header |wc -l`
if [ $nginxpid -eq 0 ];then
/etc/init.d/nginx restart
sleep 5
nginxpid=`ps -C nginx --no-header |wc -l`
if [ $nginxpid -eq 0 ];then
/etc/init.d/keepalived stop
fi
fi
sleep 5
done
本文出自 “杜海强” 博客,请务必保留此出处http://dulinux.blog.51cto.com/10803129/1708180
标签:sleep
原文地址:http://dulinux.blog.51cto.com/10803129/1708180