From a912129b34bc9fc89d30c74c33ead2a996e87c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 15 Jul 2022 20:38:05 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9a08837..529d1f0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,23 +85,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - # Create a temporary directory - tmpdir="$(mktemp -d)" - - # Backup the config file in the temp dir - cp -a "$final_path/config.php" "$tmpdir/config.php" - - # 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" - - #copy cofig.php from tmp to final_path - cp -a "$tmpdir/config.php" "$final_path/config.php" - - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.php" fi chmod 755 "$final_path" @@ -131,24 +116,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE -#================================================= - -ynh_backup_if_checksum_is_different "$final_path/conf.php" - -# Recalculate and store the config file checksum into the app settings -ynh_store_file_checksum "$final_path/config.php" - -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set right permissions for curl installation -chown -R $app: $final_path - #================================================= # RELOAD NGINX #=================================================