From 427ca75532a185a70a2d16740fc9d6317a3be4d3 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 12 Oct 2024 23:25:54 +0200 Subject: [PATCH] Update 30-monitoring.sh --- battybirdnet-pi/rootfs/custom-services.d/30-monitoring.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/battybirdnet-pi/rootfs/custom-services.d/30-monitoring.sh b/battybirdnet-pi/rootfs/custom-services.d/30-monitoring.sh index 060c318c9..ff3e9fbcc 100755 --- a/battybirdnet-pi/rootfs/custom-services.d/30-monitoring.sh +++ b/battybirdnet-pi/rootfs/custom-services.d/30-monitoring.sh @@ -89,8 +89,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