1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mopidy_ynh.git synced 2024-09-03 19:46:21 +02:00

use helper ynh_add_config

This commit is contained in:
siwinter 2021-08-23 23:03:40 +02:00 committed by GitHub
parent fb9c1e44f2
commit 0031539841
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,10 +95,6 @@ ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# SPECIFIC SETUP
#=================================================
#================================================= #=================================================
# CREATE YUNOHOST DIRECTORIES # CREATE YUNOHOST DIRECTORIES
#================================================= #=================================================
@ -116,7 +112,7 @@ chown -R $app: "$work_dir"
ynh_script_progression --message="Configuring a systemd service..." ynh_script_progression --message="Configuring a systemd service..."
# Create a dedicated systemd config # 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 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..." 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_add_config --template="../conf/app.conf" --destination="$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" #cp ../conf/app.conf "$conf_file"
ynh_replace_string --match_string="__DATA_DIR__" --replace_string=$work_dir/data --target_file="$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 # STORE THE CONFIG FILE CHECKSUM