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