From 0031539841997a21769c5b5cfbb4377dc2d0aab8 Mon Sep 17 00:00:00 2001 From: siwinter <45730097+siwinter@users.noreply.github.com> Date: Mon, 23 Aug 2021 23:03:40 +0200 Subject: [PATCH] use helper ynh_add_config --- scripts/install | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 303f0eb..8bd77d2 100755 --- a/scripts/install +++ b/scripts/install @@ -95,10 +95,6 @@ ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config - -#================================================= -# SPECIFIC SETUP -#================================================= #================================================= # CREATE YUNOHOST DIRECTORIES #================================================= @@ -116,7 +112,7 @@ chown -R $app: "$work_dir" ynh_script_progression --message="Configuring a systemd service..." # Create a dedicated systemd config -start_file="$final_path/env/bin/$app" +#start_file="$final_path/env/bin/$app" ynh_add_systemd_config #--others_var="conf_file start_file" substitute __CONF_FILE__ by $conf_file #================================================= @@ -124,12 +120,17 @@ ynh_add_systemd_config #--others_var="conf_file start_file" substitute __CO #================================================= ynh_script_progression --message="Setup config file..." -cp ../conf/app.conf "$conf_file" +cache_dir=$work_dir/cache +data_dir=$work_dir/data -ynh_replace_string --match_string="__PORT__" --replace_string=$port --target_file="$conf_file" -ynh_replace_string --match_string="__MEDIADIR__" --replace_string=$media_dir --target_file="$conf_file" -ynh_replace_string --match_string="__CACHE_DIR__" --replace_string=$work_dir/cache --target_file="$conf_file" -ynh_replace_string --match_string="__DATA_DIR__" --replace_string=$work_dir/data --target_file="$conf_file" +ynh_add_config --template="../conf/app.conf" --destination="$conf_file" + +#cp ../conf/app.conf "$conf_file" + +#ynh_replace_string --match_string="__PORT__" --replace_string=$port --target_file="$conf_file" +#ynh_replace_string --match_string="__MEDIADIR__" --replace_string=$media_dir --target_file="$conf_file" +#ynh_replace_string --match_string="__CACHE_DIR__" --replace_string=$work_dir/cache --target_file="$conf_file" +#ynh_replace_string --match_string="__DATA_DIR__" --replace_string=$work_dir/data --target_file="$conf_file" #================================================= # STORE THE CONFIG FILE CHECKSUM