From 6f05f3b9e7963e2ecd999957a8295d4b82c6a451 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 28 Aug 2021 15:06:08 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 81f3b00..09a10fd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,9 +57,9 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 # Create a temporary directory - tmpdir="$(mktemp -d)" + #tmpdir="$(mktemp -d)" - cp -a "$final_path/inc/config.php" "$tmpdir/config.php" + #cp -a "$final_path/inc/config.php" "$tmpdir/config.php" ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src @@ -67,13 +67,23 @@ then mv $final_path/Upload/* $final_path/ ynh_secure_remove --file="$final_path/Documentation" ynh_secure_remove --file="$final_path/Upload" - cp -a "$tmpdir/config.php" "$final_path/inc/config.php" + #cp -a "$tmpdir/config.php" "$final_path/inc/config.php" fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# ADD A CONFIGURATION +#================================================= +# ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="../conf/config.php" --destination="$final_path/inc/config.php" + +chmod 666 "$final_path/inc/config.php" +chown $app:$app "$final_path/inc/config.php" + #================================================= # NGINX CONFIGURATION #=================================================