From b5d4e9f264f738296ee23fb1e1000ddbed4f2c33 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 25 Sep 2021 13:14:04 +0200 Subject: [PATCH] add_config --- hooks/post_user_create | 2 +- scripts/install | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/hooks/post_user_create b/hooks/post_user_create index 83dedf0..c240023 100644 --- a/hooks/post_user_create +++ b/hooks/post_user_create @@ -1,6 +1,6 @@ #!/bin/bash app=__APP__ -src_path=__SRCPATH__ +src_path=__FINALPATH__ member=__MEMBER__ # Sync users diff --git a/scripts/install b/scripts/install index 20c287f..95a6ff1 100644 --- a/scripts/install +++ b/scripts/install @@ -118,14 +118,7 @@ ynh_add_nginx_config # PREPARE AND INSTALL APP #================================================= -finstall="$final_path/htdocs/install/install.forced.php" -cp ../conf/install.forced.php "$finstall" - -# Change variables in Dolibarr configuration -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$finstall" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$finstall" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$finstall" -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$finstall" +ynh_add_config --template="/conf/install.forced.php" --destination="$final_path/htdocs/install/install.forced.php" #================================================= # CONFIGURE THE HOOK FILE FOR USER CREATE @@ -133,7 +126,7 @@ ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target fhook=../hooks/post_user_create ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$fhook" ynh_replace_string --match_string="__MEMBER__" --replace_string="$member" --target_file="$fhook" -ynh_replace_string --match_string="__SRCPATH__" --replace_string="$final_path" --target_file="$fhook" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$fhook" #================================================= # SETUP APPLICATION WITH CURL