From 884c90096314f62247b4b0d829603c1595f05d9e Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:02:28 +0100 Subject: [PATCH] Fix restarts --- 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 17fa7a0ac6..5b31470219 100755 --- a/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh +++ b/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh @@ -90,8 +90,8 @@ while true; do # Check service states for service in "$srv" "$srv2"; do - state_var="${service}_state" - if [[ "${state_var:-}" != "active" ]]; then + state="$(systemctl is-active "$service")" + if [[ "$state" != "active" ]]; then log_yellow "$(date) INFO: Restarting $service service" sudo systemctl restart "$service" fi