From 013681cea3524a7acb11cd3cef6978a043f3b229 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 12 Oct 2024 23:24:13 +0200 Subject: [PATCH] Update 30-monitoring.sh --- birdnet-pi/rootfs/custom-services.d/30-monitoring.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh b/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh index cf065be70..62d9f9991 100755 --- a/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh +++ b/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh @@ -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