mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-06 05:27:44 +03:00
If previous config was yaml, migrate to yaml
This commit is contained in:
parent
f166746c85
commit
a72004d8a9
@ -19,20 +19,19 @@ function migrate_addon_config_dir() {
|
|||||||
# Already migrated
|
# Already migrated
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
unset new_config_file new_config_file_yaml
|
|
||||||
|
|
||||||
local old_config_file="${home_assistant_config_dir}/frigate.yml"
|
local old_config_file="${home_assistant_config_dir}/frigate.yml"
|
||||||
local old_config_file_yaml="${old_config_file//.yml/.yaml}"
|
local old_config_file_yaml="${old_config_file//.yml/.yaml}"
|
||||||
local new_config_file="${config_dir}/config.yml"
|
|
||||||
if [[ -f "${old_config_file}" ]]; then
|
if [[ -f "${old_config_file}" ]]; then
|
||||||
:
|
:
|
||||||
elif [[ -f "${old_config_file_yaml}" ]]; then
|
elif [[ -f "${old_config_file_yaml}" ]]; then
|
||||||
old_config_file="${old_config_file_yaml}"
|
old_config_file="${old_config_file_yaml}"
|
||||||
|
new_config_file="${new_config_file_yaml}"
|
||||||
else
|
else
|
||||||
# Nothing to migrate
|
# Nothing to migrate
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
unset old_config_file_yaml
|
unset old_config_file_yaml new_config_file new_config_file_yaml
|
||||||
|
|
||||||
local db_path
|
local db_path
|
||||||
db_path=$(yq -r '.database.path' "${old_config_file}")
|
db_path=$(yq -r '.database.path' "${old_config_file}")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user