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

 

posted @ 2021-04-26 19:23  huakai201  阅读(76)  评论(0编辑  收藏  举报