#!/bin/bash
while true
do
if [ $(pidof httpd|wc -l) -eq 1 -a $(pidof keepalived|wc -l) -eq 0 ]
then systemctl start keepalived
fi
pidof httpd &>/dev/null
if [ $? -ne 0 ]
then systemctl start httpd &>/dev/null
fi
sleep 3
pidof httpd &>/dev/null
if [ $? -ne 0 ]
then systemctl stop keepalived
fi
sleep 3
done
shell脚本-keepalived监控
最新推荐文章于 2025-04-20 12:18:53 发布