From 224ca2fd3ebe83538429f3843c5ea4c054af8d30 Mon Sep 17 00:00:00 2001 From: riley Date: Wed, 27 Sep 2023 18:47:25 -0400 Subject: [PATCH] Comment remove function refactor due to lack of bash --- root/usr/libexec/apps/frigate/frigate.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/root/usr/libexec/apps/frigate/frigate.sh b/root/usr/libexec/apps/frigate/frigate.sh index 5734c27..8fe1634 100755 --- a/root/usr/libexec/apps/frigate/frigate.sh +++ b/root/usr/libexec/apps/frigate/frigate.sh @@ -263,18 +263,16 @@ overwrite_warning_comment() { } remove_warning_comments() { local name=$1 - # Attribute list to remove warning comments - local attributes=( - "ffmpeg.inputs[0].path" - "ffmpeg.inputs[0].roles" - "record.enabled" - "snapshots.enabled" - "motion.mask" - ) - - for attribute in "${attributes[@]}"; do - yq '.cameras.'$name'.'$attribute' line_comment=""' -i /opt/docker2/compose/frigate/config.yml - done + + yq '.cameras.'$name'.ffmpeg.inputs[0].path line_comment=""' -i /opt/docker2/compose/frigate/config.yml + + yq '.cameras.'$name'.ffmpeg.inputs[0].roles line_comment=""' -i /opt/docker2/compose/frigate/config.yml + + yq '.cameras.'$name'.record.enabled line_comment=""' -i /opt/docker2/compose/frigate/config.yml + + yq '.cameras.'$name'.snapshots.enabled line_comment=""' -i /opt/docker2/compose/frigate/config.yml + + yq '.cameras.'$name'.motion.mask line_comment=""' -i /opt/docker2/compose/frigate/config.yml } @@ -344,7 +342,7 @@ sync_camera_config() { fi else echo "Skipping camera $camera_name, overwrite is set to false." - remove_warning_comment $camera_name + remove_warning_comments $camera_name fi # Add to uci_cameras