Comment remove function refactor due to lack of bash

pull/3/head
riley 12 months ago
parent c74c1b7302
commit 224ca2fd3e

@ -263,18 +263,16 @@ overwrite_warning_comment() {
} }
remove_warning_comments() { remove_warning_comments() {
local name=$1 local name=$1
# Attribute list to remove warning comments
local attributes=( yq '.cameras.'$name'.ffmpeg.inputs[0].path line_comment=""' -i /opt/docker2/compose/frigate/config.yml
"ffmpeg.inputs[0].path"
"ffmpeg.inputs[0].roles" yq '.cameras.'$name'.ffmpeg.inputs[0].roles line_comment=""' -i /opt/docker2/compose/frigate/config.yml
"record.enabled"
"snapshots.enabled" yq '.cameras.'$name'.record.enabled line_comment=""' -i /opt/docker2/compose/frigate/config.yml
"motion.mask"
) yq '.cameras.'$name'.snapshots.enabled line_comment=""' -i /opt/docker2/compose/frigate/config.yml
for attribute in "${attributes[@]}"; do yq '.cameras.'$name'.motion.mask line_comment=""' -i /opt/docker2/compose/frigate/config.yml
yq '.cameras.'$name'.'$attribute' line_comment=""' -i /opt/docker2/compose/frigate/config.yml
done
} }
@ -344,7 +342,7 @@ sync_camera_config() {
fi fi
else else
echo "Skipping camera $camera_name, overwrite is set to false." echo "Skipping camera $camera_name, overwrite is set to false."
remove_warning_comment $camera_name remove_warning_comments $camera_name
fi fi
# Add to uci_cameras # Add to uci_cameras

Loading…
Cancel
Save