From c558e3a8400e658e7d25f8ba9b2a1f92bb5fa307 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Sun, 23 Mar 2025 13:29:39 -0300 Subject: [PATCH] Support config.json in migration shell scripts --- docker/main/rootfs/etc/s6-overlay/s6-rc.d/prepare/run | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/prepare/run b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/prepare/run index a9a7b71d4..83187a0e4 100755 --- a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/prepare/run +++ b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/prepare/run @@ -35,7 +35,7 @@ function migrate_addon_config_dir() { unset old_config_file_yaml local db_path - db_path=$(yq eval '.database.path' "${old_config_file}") + db_path=$(yq -r '.database.path' "${old_config_file}") if [[ "${db_path}" == "null" ]]; then db_path="${config_dir}/frigate.db" fi @@ -53,7 +53,7 @@ function migrate_addon_config_dir() { fi local model_path - model_path=$(yq eval '.model.path' "${old_config_file}") + model_path=$(yq -r '.model.path' "${old_config_file}") if [[ "${model_path}" == "${config_dir}/"* ]]; then # replace /config/ prefix with /homeassistant/ local old_model_path="${home_assistant_config_dir}/${model_path:8}" @@ -68,7 +68,7 @@ function migrate_addon_config_dir() { fi local ffmpeg_path - ffmpeg_path=$(yq eval '.ffmpeg.path' "${old_config_file}") + ffmpeg_path=$(yq -r '.ffmpeg.path' "${old_config_file}") if [[ "${ffmpeg_path}" == "${config_dir}/"* ]]; then # replace /config/ prefix with /homeassistant/ local old_ffmpeg_path="${home_assistant_config_dir}/${ffmpeg_path:8}" @@ -118,8 +118,7 @@ function migrate_db_from_media_to_config() { unset config_file_yaml local user_db_path - user_db_path=$(yq eval '.database.path' "${config_file}") - + user_db_path=$(yq -r '.database.path' "${config_file}") if [[ "${user_db_path}" == "null" ]]; then local old_db_path="/media/frigate/frigate.db" local new_db_dir="/config"