From 77a3273329e6f0950ec27465ad5fe79e2163aa86 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 26 Mar 2021 23:04:43 +0100 Subject: [PATCH] Update upgrade --- scripts/upgrade | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 3d45c33..0472cf6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -64,8 +64,23 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=2 + # Create a temporary directory + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + cp -a "$final_path/matterbridge.toml" "$tmpdir/matterbridge.toml" + + # Remove the app directory securely + ynh_secure_remove --file="$final_path" + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" + + # Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/matterbridge.toml" "$final_path/matterbridge.toml" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi #=================================================