mirror of
https://github.com/YunoHost-Apps/garradin_ynh.git
synced 2024-09-03 18:36:17 +02:00
put condition in install and update for config.local.php
This commit is contained in:
parent
0aa1ea1b35
commit
3aeae720be
2 changed files with 18 additions and 11 deletions
|
@ -86,10 +86,9 @@ ynh_setup_source --dest_dir="$final_path"
|
||||||
|
|
||||||
#echo "const WWW_URI = '$path_url/';" >> $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
|
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"
|
||||||
# ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php"
|
# ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php"
|
||||||
# ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php"
|
# ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$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"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# Files owned by user app
|
# Files owned by user app
|
||||||
|
|
|
@ -54,6 +54,7 @@ ynh_script_progression --message="Backing up the bdd and squelettes before upgra
|
||||||
|
|
||||||
bdd=$final_path/association.sqlite
|
bdd=$final_path/association.sqlite
|
||||||
squelettes=$final_path/www/squelettes
|
squelettes=$final_path/www/squelettes
|
||||||
|
conf=$final_path/www/config.local.php
|
||||||
|
|
||||||
if [ -d "$squelettes" ]
|
if [ -d "$squelettes" ]
|
||||||
then
|
then
|
||||||
|
@ -65,6 +66,11 @@ then
|
||||||
cp -a $bdd /tmp/association.sqlite
|
cp -a $bdd /tmp/association.sqlite
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -e "$conf" ]
|
||||||
|
then
|
||||||
|
cp -a $bdd /tmp/config.local.php
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -127,26 +133,28 @@ fi
|
||||||
|
|
||||||
backup_bdd=/tmp/association.sqlite
|
backup_bdd=/tmp/association.sqlite
|
||||||
backup_squelettes=/tmp/squelettes
|
backup_squelettes=/tmp/squelettes
|
||||||
|
backup_conf=/tmp/config.local.php
|
||||||
|
|
||||||
if [ -d "$backup_squelettes" ]
|
if [ -d "$backup_squelettes" ]
|
||||||
then
|
then
|
||||||
cp -ar /tmp/squelettes $final_path/www/squelettes
|
cp -ar $backup_squelettes $final_path/www/squelettes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e "$backup_bdd" ]
|
if [ -e "$backup_bdd" ]
|
||||||
then
|
then
|
||||||
cp -a /tmp/association.sqlite $final_path/association.sqlite
|
cp -a $backup_bdd $final_path/association.sqlite
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
if [ -e "$backup_conf" ]
|
||||||
# Change options in file config.dist.php
|
then
|
||||||
# and copy in local.dist.php
|
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
|
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"
|
# ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$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"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
|
Loading…
Add table
Reference in a new issue