ch_nginx.sh
#!/bin/bash counter=`ps -ef |grep nginx |grep -v grep | wc -l` if [ $counter = 0 ];then service nginx start sleep 5 counter=`ps -ef |grep nginx |grep -v grep | wc -l` if [ $counter = 0 ];then systemctl stop keepalived fi fi
#!/bin/bash counter=`ps -ef |grep nginx |grep -v grep | wc -l` if [ $counter = 0 ];then service nginx start sleep 5 counter=`ps -ef |grep nginx |grep -v grep | wc -l` if [ $counter = 0 ];then systemctl stop keepalived fi fi