diff --git a/scripts/upgrade b/scripts/upgrade index e268d2d..3edf134 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,6 +86,12 @@ ynh_app_setting_set --app=$app --key=discovery_client --value=$discovery_client #================================================= ynh_script_progression --message="Upgrading packages..." --weight=3 +# Backup the configuration files to prevent yunohost to see a manual edit +bakdir=$(mktemp -d) +for name in system.xml network.xml logging.json; do + cp "$config_path/$name" "$bakdir/$name" +done + # ynh_package_install passes --no-remove so the ffmpeg5 -> ffmpeg6 migration is blocked. # So we remove the packages before installing the new ones. if ynh_package_is_installed "jellyfin-ffmpeg5"; then @@ -111,6 +117,12 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=2 +# Restore the files we just backed up before installing the debs... +for name in system.xml network.xml logging.json; do + mv -f "$bakdir/$name" "$config_path/$name" +done +ynh_secure_remove "$bakdir" + # TODO: investigate if we can avoid overriding system.xml #ynh_add_config --template="system.xml" --destination="$config_path/system.xml" ynh_add_config --template="network.xml" --destination="$config_path/network.xml"