From 6e88b09c061a695975ba363a1c61b066b0ac85f3 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Thu, 9 Apr 2020 12:27:38 +0200 Subject: [PATCH] try to save secret key if exist on update --- scripts/upgrade | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 46e9e05..a07782c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,7 +54,6 @@ ynh_script_progression --message="Backing up the bdd and squelettes before upgra bdd=$final_path/association.sqlite squelettes=$final_path/www/squelettes -conf=$final_path/www/config.local.php if [ -d "$squelettes" ] then @@ -66,11 +65,6 @@ then cp -a $bdd /tmp/association.sqlite fi -if [ -e "$conf" ] -then - cp -a $bdd /tmp/config.local.php -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -194,7 +188,6 @@ ynh_systemd_action --service_name=nginx --action=reload backup_bdd=/tmp/association.sqlite backup_squelettes=/tmp/squelettes -backup_conf=/tmp/config.local.php if [ -d "$backup_squelettes" ] then @@ -206,12 +199,10 @@ then cp -a $backup_bdd $final_path/association.sqlite fi -if [ -e "$backup_conf" ] -then - cp -a $backup_conf $final_path/config.local.php && echo "const WWW_URI = '$path_url/';" >> $final_path/config.local.php -else - cp -a $final_path/config.dist.php $final_path/config.local.php - ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" +echo "const WWW_URI = '$path_url/';" >> $final_path/config.local.php + +#cp -a $final_path/config.dist.php $final_path/config.local.php +# ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" fi # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php"