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