diff --git a/conf/systemd.service b/conf/systemd.service index 3402c6e..fa73915 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,7 +10,7 @@ WantedBy=multi-user.target User=__APP__ Group=__APP__ Type=simple -ExecStart=__FINAL_PATH__/__APP__ --configfile "__CONFIG_PATH__/navidrome.toml" +ExecStart=__FINALPATH__/__APP__ --configfile "__CONFIG_PATH__/navidrome.toml" WorkingDirectory=__CONFIG_PATH__ TimeoutStopSec=20 KillMode=process diff --git a/scripts/install b/scripts/install index a336505..464257e 100644 --- a/scripts/install +++ b/scripts/install @@ -109,13 +109,8 @@ ynh_script_progression --message="Modifying a config file..." --weight=1 config_path="/var/lib/$app" mkdir -p "$config_path" -cp ../conf/navidrome.toml "$config_path/navidrome.toml" - # Main config File -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$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_add_config --template="../conf/navidrome.toml" --destination="$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_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_add_systemd_config #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4f78b08..d5a7b8c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -121,11 +121,10 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=2 config_path="/var/lib/$app" -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_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml" # 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 #=================================================