diff --git a/conf/__APP__.sh b/conf/__APP__.sh deleted file mode 100644 index 339962b..0000000 --- a/conf/__APP__.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -__FINALPATH__/cowyo --port __PORT__ --host localhost diff --git a/conf/systemd.service b/conf/systemd.service index 9152cd1..ee8d466 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/__APP__.sh >> /var/log/__APP__.log 2>&1 +ExecStart=__FINALPATH__/cowyo --port __PORT__ --host localhost >> /var/log/__APP__.log 2>&1 [Install] WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index 6ade36b..606e0b9 100644 --- a/scripts/install +++ b/scripts/install @@ -94,18 +94,12 @@ ynh_system_user_create $app #================================================= ynh_script_progression --message="Configuring a systemd service..." --time --weight=1 +# Set the systemd service settings +ynh_replace_string "__PORT__" "$port" "../conf/systemd.service" + # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# MODIFY A CONFIG FILE -#================================================= - -cp ../conf/__APP__.sh "$final_path/${app}.sh" -ynh_replace_string "__PORT__" "$port" "$final_path/${app}.sh" -ynh_replace_string "__FINALPATH__" "$final_path" "$final_path/${app}.sh" -chmod +x "$final_path/${app}.sh" - #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 99a076d..81454e2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -140,6 +140,9 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 +# Set the systemd service settings +ynh_replace_string "__PORT__" "$port" "../conf/systemd.service" + # Create a dedicated systemd config ynh_add_systemd_config