From 0ff27caa4fe7af0607b64f0158a6aa6ddb1e5575 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 15 Feb 2021 12:06:43 +0100 Subject: [PATCH] Fix --- scripts/install | 13 ++----------- scripts/upgrade | 24 ++---------------------- 2 files changed, 4 insertions(+), 33 deletions(-) diff --git a/scripts/install b/scripts/install index 6189138..a504468 100644 --- a/scripts/install +++ b/scripts/install @@ -133,17 +133,8 @@ pushd "$final_path" || ynh_die #================================================= ynh_script_progression --message="Configuring Etherpad..." --weight=6 -cp ../conf/settings.json $final_path/settings.json - -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/settings.json" -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/settings.json" - -cp ../conf/credentials.json $final_path/credentials.json - -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/credentials.json" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/credentials.json" -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/credentials.json" -ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/credentials.json" +ynh_add_config --template="../conf/settings.json" --destination="$final_path/settings.json" +ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json" #================================================= # STORE THE CONFIG FILE CHECKSUM diff --git a/scripts/upgrade b/scripts/upgrade index 9c07e5c..ca41475 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -124,33 +124,13 @@ ynh_script_progression --message="Making sure dedicated system user exists..." - # Create a dedicated user (if not existing) ynh_system_user_create --username=$app -# #================================================= -# # INSTALL ETHERPAD -# #================================================= -# ynh_script_progression --message="Installing Etherpad..." --weight=90 - -# chown -R $app: $final_path - -# pushd "$final_path" -# ynh_exec_as $app env "$ynh_node_load_PATH" bin/installDeps.sh -# popd - #================================================= # MODIFY A CONFIG FILE #================================================= ynh_script_progression --message="Reconfiguring Etherpad..." --weight=6 -cp ../conf/settings.json $final_path/settings.json - -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/settings.json" -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/settings.json" - -cp ../conf/credentials.json $final_path/credentials.json - -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/credentials.json" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/credentials.json" -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/credentials.json" -ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/credentials.json" +ynh_add_config --template="../conf/settings.json" --destination="$final_path/settings.json" +ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json" #================================================= # GENERIC FINALIZATION