1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garradin_ynh.git synced 2024-09-03 18:36:17 +02:00

try to save secret key if exist on update

This commit is contained in:
Robles Rodolphe 2020-04-09 12:27:38 +02:00
parent b40973c0a5
commit 6e88b09c06

View file

@ -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"