diff --git a/scripts/upgrade b/scripts/upgrade index 7d9c0de..739633c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -72,7 +72,7 @@ then ynh_script_progression --message="Upgrading source files..." --time --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="$final_path/.env" + ynh_setup_source --dest_dir="$final_path" --keep=".env" fi # FIXME: this should be managed by the core in the future @@ -118,6 +118,20 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config ynh_add_fpm_config --package="$extra_php_dependencies" +#================================================= +# UPDATE A CONFIG FILE +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Updating a configuration file..." + + ynh_add_config --template="default.env" --destination="$final_path/.env" + + chmod 400 "$final_path/.env" + chown $app:$app "$final_path/.env" +fi + #================================================= # UPGRADE DATABASE #=================================================