mirror of
https://github.com/YunoHost-Apps/paheko_ynh.git
synced 2024-09-03 19:56:22 +02:00
try more simple syntax
This commit is contained in:
parent
8595bbc22e
commit
b38485adcc
3 changed files with 17 additions and 19 deletions
|
@ -887,7 +887,7 @@ const MAIL_SENDER = '__APP__@__DOMAIN__';
|
||||||
//const ALERT_MESSAGE = 'Ceci est un compte de test.';
|
//const ALERT_MESSAGE = 'Ceci est un compte de test.';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chemin vers le fichier pour des configurations personnellesqui ne sera pas écraser
|
* Chemin vers le fichier pour des configurations personnelles qui ne sera pas écraser
|
||||||
* lors des mises à jour. Cette ligne sera décommentée dès la première mise à jour.
|
* lors des mises à jour. Cette ligne sera décommentée dès la première mise à jour.
|
||||||
*/
|
*/
|
||||||
//require '__DATA_DIR__/data/config.local.user.php';
|
//require '__DATA_DIR__/data/config.local.user.php';
|
||||||
|
|
|
@ -9,4 +9,4 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Nécessaire pour situer les constantes dans le bon namespace
|
// Nécessaire pour situer les constantes dans le bon namespace
|
||||||
namespace Paheko;
|
namespace Paheko;
|
||||||
|
|
|
@ -67,17 +67,22 @@ chmod 644 "/etc/cron.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
# add the newest config.local.php from older version
|
# UPDATE A CONFIG FILE
|
||||||
if ynh_compare_current_package_version --comparison lt --version 1.3.1~ynh1
|
#=================================================
|
||||||
then
|
ynh_script_progression --message="Updating a configuration file..." --weight=5
|
||||||
ynh_script_progression --message="Updating a configuration file..." --weight=5
|
|
||||||
|
|
||||||
ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php"
|
# Install configuration files
|
||||||
chmod 650 "$install_dir/config.local.php"
|
ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php"
|
||||||
chown $app:$app "$install_dir/config.local.php"
|
|
||||||
fi
|
chmod 650 "$install_dir/config.local.php"
|
||||||
|
chown $app:$app "$install_dir/config.local.php"
|
||||||
|
|
||||||
|
ynh_replace_string --match_string="//require '$data_dir/data/config.local.user.php';" --replace_string="require '$data_dir/data/config.local.user.php';" --target_file="$install_dir/config.local.php"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ADD A CONFIG FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# add config file if not present
|
|
||||||
if [ ! -d "$data_dir/data" ]; then
|
if [ ! -d "$data_dir/data" ]; then
|
||||||
ynh_script_progression --message="Adding a configuration file..." --weight=5
|
ynh_script_progression --message="Adding a configuration file..." --weight=5
|
||||||
mkdir "$data_dir/data"
|
mkdir "$data_dir/data"
|
||||||
|
@ -90,16 +95,9 @@ if [ ! -f "$data_dir/data/config.local.user.php" ]; then
|
||||||
ynh_add_config --template="config.local.user.php" --destination="$data_dir/data/config.local.user.php"
|
ynh_add_config --template="config.local.user.php" --destination="$data_dir/data/config.local.user.php"
|
||||||
chmod 650 "$data_dir/data/config.local.user.php"
|
chmod 650 "$data_dir/data/config.local.user.php"
|
||||||
chown $app:$app "$data_dir/data/config.local.user.php"
|
chown $app:$app "$data_dir/data/config.local.user.php"
|
||||||
echo "
|
|
||||||
/**
|
|
||||||
* Chemin vers le fichier pour des configurations personnelles
|
|
||||||
* qui ne sera pas écraser lors des mises à jour.
|
|
||||||
*/
|
|
||||||
require '$data_dir/data/config.local.user.php';" >> $install_dir/config.local.php
|
|
||||||
else
|
|
||||||
ynh_replace_string --match_string="//require '$data_dir/data/config.local.user.php';" --replace_string="require '$data_dir/data/config.local.user.php';" --target_file="$install_dir/config.local.php"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue