From 1d09b2b4bf95edf24ac404286986f1c16640e018 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Tue, 15 Sep 2026 10:51:42 +0200 Subject: [PATCH] frigate: write the config in one place Only the detector and model section depends on the CPU check, but the file was assembled in three heredocs writing to the same path. That shape is what produced the safe-mode config: both branches used a plain redirect and discarded everything above them. Pick the variable part into DETECTOR_CONFIG first and write the file once, so the layout is visible in one block and no branch can replace what came before it. Output is unchanged, verified by generating both branches from the previous commit and from this one and diffing: byte-identical. --- install/frigate-install.sh | 39 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/install/frigate-install.sh b/install/frigate-install.sh index 3cdf4fe17..081f9cbb0 100644 --- a/install/frigate-install.sh +++ b/install/frigate-install.sh @@ -269,6 +269,23 @@ GLOG_minloglevel=3 GLOG_logtostderr=0 EOF +if grep -q -o -m1 -E 'avx[^ ]*|sse4_2' /proc/cpuinfo && [[ -f /openvino-model/ssdlite_mobilenet_v2.xml ]] && [[ -f /openvino-model/coco_91cl_bkgr.txt ]]; then + DETECTOR_CONFIG="detectors: + detector01: + type: openvino + device: AUTO +model: + width: 300 + height: 300 + input_tensor: nhwc + input_pixel_format: bgr + path: /openvino-model/ssdlite_mobilenet_v2.xml + labelmap_path: /openvino-model/coco_91cl_bkgr.txt" +else + DETECTOR_CONFIG="model: + path: /models/cpu_model.tflite" +fi + cat </config/config.yml mqtt: enabled: false @@ -290,28 +307,8 @@ detect: enabled: false ffmpeg: hwaccel_args: auto +${DETECTOR_CONFIG} EOF - -if grep -q -o -m1 -E 'avx[^ ]*|sse4_2' /proc/cpuinfo && [[ -f /openvino-model/ssdlite_mobilenet_v2.xml ]] && [[ -f /openvino-model/coco_91cl_bkgr.txt ]]; then - cat <>/config/config.yml -detectors: - detector01: - type: openvino - device: AUTO -model: - width: 300 - height: 300 - input_tensor: nhwc - input_pixel_format: bgr - path: /openvino-model/ssdlite_mobilenet_v2.xml - labelmap_path: /openvino-model/coco_91cl_bkgr.txt -EOF -else - cat <>/config/config.yml -model: - path: /models/cpu_model.tflite -EOF -fi msg_ok "Configured Frigate" msg_info "Creating Services"