|
|
@ -203,7 +203,16 @@ sync_camera_config() {
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Then, handle deletions:
|
|
|
|
# Then, handle deletions:
|
|
|
|
local cameras_in_yml=$(yq eval '.cameras | keys[]' /opt/docker2/compose/frigate/config.yml)
|
|
|
|
local num_cameras=$(yq eval '.cameras | length' /opt/docker2/compose/frigate/config.yml 2>/dev/null)
|
|
|
|
|
|
|
|
local i=0
|
|
|
|
|
|
|
|
local cameras_in_yml=""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while [ "$i" -lt "$num_cameras" ]; do
|
|
|
|
|
|
|
|
local camera_name=$(yq eval ".cameras | keys[$i]" /opt/docker2/compose/frigate/config.yml 2>/dev/null)
|
|
|
|
|
|
|
|
cameras_in_yml="$cameras_in_yml $camera_name"
|
|
|
|
|
|
|
|
i=$((i+1))
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
echo "Checking for cameras in YML that are not in UCI..."
|
|
|
|
echo "Checking for cameras in YML that are not in UCI..."
|
|
|
|
for camera_name in $cameras_in_yml; do
|
|
|
|
for camera_name in $cameras_in_yml; do
|
|
|
|
echo "Validating camera: $camera_name in UCI"
|
|
|
|
echo "Validating camera: $camera_name in UCI"
|
|
|
|