From 5ac33e41f924234215c6e5d7a956c3d2844329a2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Jun 2021 18:53:34 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6644832..9155b83 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,8 +83,21 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=3 +# Create a temporary directory + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + cp -a "$final_path/searx/settings.yml" "$tmpdir/settings.yml" + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + + # Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/settings.yml" "$final_path/searx/settings.yml" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" + fi #================================================= @@ -122,11 +135,11 @@ pip3 install --requirement $final_path/requirements-ynh.txt --upgrade #================================================= # CONFIGURE SEARX #================================================= -ynh_script_progression --message="Configuring Searx..." --weight=2 +# ynh_script_progression --message="Configuring Searx..." --weight=2 -secret_key=$(ynh_string_random) +# secret_key=$(ynh_string_random) -ynh_add_config --template="../conf/settings.yml" --destination="$final_path/searx/settings.yml" +# ynh_add_config --template="../conf/settings.yml" --destination="$final_path/searx/settings.yml" #================================================= # GENERIC FINALISATION