From c41b6cc63f410d89ab6db3e2d574832d13021674 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 10 Oct 2021 09:16:12 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0caa80b..d404251 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -78,19 +78,11 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=10 - # Create a temporary directory - tmpdir="$(mktemp -d)" - - cp -a "$final_path/config/config.json" "$tmpdir/config.json" # 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 - cp -a "$tmpdir/config.json" "$final_path/config/config.json" - - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" fi #================================================= @@ -137,6 +129,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# MODIFY A CONFIG FILE +#================================================= +ynh_script_progression --message="Modifying a config file..." --weight=2 + +ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config/config.json" +chmod 600 $final_path/config/config.json + #================================================= # INTEGRATE SERVICE IN YUNOHOST #=================================================