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

Simplify config (#44)

* Simplify config
This commit is contained in:
Éric Gaspar 2021-02-19 23:24:30 +01:00 committed by GitHub
parent 30ea6a10dd
commit 8eb668f6db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 13 deletions

View file

@ -10,7 +10,7 @@ WantedBy=multi-user.target
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
Type=simple Type=simple
ExecStart=__FINAL_PATH__/__APP__ --configfile "__CONFIG_PATH__/navidrome.toml" ExecStart=__FINALPATH__/__APP__ --configfile "__CONFIG_PATH__/navidrome.toml"
WorkingDirectory=__CONFIG_PATH__ WorkingDirectory=__CONFIG_PATH__
TimeoutStopSec=20 TimeoutStopSec=20
KillMode=process KillMode=process

View file

@ -109,13 +109,8 @@ ynh_script_progression --message="Modifying a config file..." --weight=1
config_path="/var/lib/$app" config_path="/var/lib/$app"
mkdir -p "$config_path" mkdir -p "$config_path"
cp ../conf/navidrome.toml "$config_path/navidrome.toml"
# Main config File # Main config File
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/navidrome.toml" ynh_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config_path/navidrome.toml"
ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="$config_path/navidrome.toml"
ynh_store_file_checksum --file="$config_path/navidrome.toml" ynh_store_file_checksum --file="$config_path/navidrome.toml"
#================================================= #=================================================
@ -123,10 +118,7 @@ ynh_store_file_checksum --file="$config_path/navidrome.toml"
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_script_progression --message="Configuring a systemd service..." --weight=1
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="../conf/systemd.service" ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="../conf/systemd.service"
ynh_add_systemd_config ynh_add_systemd_config
#================================================= #=================================================

View file

@ -121,11 +121,10 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=2
config_path="/var/lib/$app" config_path="/var/lib/$app"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/systemd.service" ynh_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml"
ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="../conf/systemd.service"
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="../conf/systemd.service"
ynh_add_systemd_config ynh_add_systemd_config
#================================================= #=================================================