Update 30-monitoring.sh

This commit is contained in:
Alexandre
2024-10-12 23:24:13 +02:00
committed by GitHub
parent 0d230577ad
commit 013681cea3

View File

@@ -87,8 +87,8 @@ while true; do
# Check service states
for service in "$srv" "$srv2"; do
local state_var="${service}_state"
if [[ "${!state_var}" != "active" ]]; then
state_var="${service}_state"
if [[ "${state_var:-}" != "active" ]]; then
log_yellow "$(date) INFO: Restarting $service service"
sudo systemctl restart "$service"
fi