nginx心跳脚本--(配合keepalived)

nginx心跳脚本--(配合keepalived)

#!/bin/bash
#
#********************************************************************
#Author:          nwq
#QQ:              3078499367
#Date:            2024-07-22
#FileName:       nginx_check.sh
#URL:             http://www.sansi.fun
#Description:     The test script
#Copyright (C):   2024 All rights reserved
#********************************************************************
nginxpid=`ps -C nginx --no-header | wc -l`
if [ $nginxpid -eq 0 ];then
        systemctl stop keepalived
        pkill -9 keepalived   
fi





posted @ 2024-04-28 23:49  三思博客  阅读(4)  评论(0编辑  收藏  举报