diff --git a/scripts/install b/scripts/install index 2e8032b..f1c9abe 100644 --- a/scripts/install +++ b/scripts/install @@ -142,13 +142,12 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config for the web UI ynh_add_systemd_config --service=wireguard_ui --template=wireguard_ui.service -# Create a dedicated systemd config for monitoring WireGuard's configuration -cp ../conf/wireguard@.path /etc/systemd/system/wireguard@.path -systemctl enable --quiet wireguard@wg0.path - -# Create a dedicated systemd config for WireGuard +# Create dedicated systemd configs for starting and monitoring WireGuard's configuration cp ../conf/wireguard@.service /etc/systemd/system/wireguard@.service +cp ../conf/wireguard@.path /etc/systemd/system/wireguard@.path +systemctl daemon-reload systemctl enable --quiet wireguard@wg0.service +systemctl enable --quiet --now wireguard@wg0.path #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index e9787ad..27195bd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -110,12 +110,14 @@ ynh_remove_extra_repo --name=$app ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_restore_file --origin_path=/etc/systemd/system/wireguard_ui.service -ynh_restore_file --origin_path=/etc/systemd/system/wireguard@.path ynh_restore_file --origin_path=/etc/systemd/system/wireguard@.service +ynh_restore_file --origin_path=/etc/systemd/system/wireguard@.path + +systemctl daemon-reload systemctl enable --quiet wireguard_ui.service -systemctl enable --quiet wireguard@wg0.path -systemctl enable --quiet wireguard@wg0.service +systemctl enable --quiet --now wireguard@wg0.service +systemctl enable --quiet --now wireguard@wg0.path #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/upgrade b/scripts/upgrade index 2057243..1071be5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -178,13 +178,12 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config for the web UI ynh_add_systemd_config --service=wireguard_ui --template=wireguard_ui.service -# Create a dedicated systemd config for monitoring WireGuard's configuration -cp ../conf/wireguard@.path /etc/systemd/system/wireguard@.path -systemctl enable --quiet wireguard@wg0.path - -# Create a dedicated systemd config for restarting WireGuard when its configuration changes +# Create dedicated systemd configs for starting and monitoring WireGuard's configuration cp ../conf/wireguard@.service /etc/systemd/system/wireguard@.service +cp ../conf/wireguard@.path /etc/systemd/system/wireguard@.path +systemctl daemon-reload systemctl enable --quiet wireguard@wg0.service +systemctl enable --quiet --now wireguard@wg0.path #================================================= # CONFIGURING WIREGUARD