diff --git a/README.md b/README.md index 1710f1d..b23f95f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in WireGuard® is fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN. -**Shipped version:** 0.3.6~ynh1 +**Shipped version:** 0.3.6~ynh2 diff --git a/README_fr.md b/README_fr.md index caabf52..80eaa0a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour WireGuard® is fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN. -**Version incluse :** 0.3.6~ynh1 +**Version incluse :** 0.3.6~ynh2 diff --git a/conf/wireguard@.service b/conf/wireguard@.service index 17eb385..2b089af 100644 --- a/conf/wireguard@.service +++ b/conf/wireguard@.service @@ -6,9 +6,7 @@ Wants=network-online.target nss-lookup.target [Service] Type=oneshot User=root -RemainAfterExit=yes ExecStart=/bin/systemctl restart wg-quick@%I.service -ExecStop=/bin/systemctl stop wg-quick@%I.service [Install] WantedBy=multi-user.target diff --git a/manifest.json b/manifest.json index c7741d8..30b69d4 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Web user interface to manage your WireGuard setup", "fr": "Interface utilisateur Web pour gérer votre configuration WireGuard" }, - "version": "0.3.6~ynh1", + "version": "0.3.6~ynh2", "url": "https://github.com/ngoduykhanh/wireguard-ui", "upstream": { "license": "MIT", diff --git a/scripts/_common.sh b/scripts/_common.sh index 283eb68..64cf3e4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -15,7 +15,7 @@ fi # dependencies used by the app pkg_dependencies="$pkg_headers wireguard-dkms wireguard" -interface=$(ip route | awk '/default/ { print $5 }') +interface=$(ip route | awk '/default/ { print $5 }' | head -n1) main_domain=$(cat /etc/yunohost/current_host) diff --git a/scripts/install b/scripts/install index d95861d..fd862ce 100644 --- a/scripts/install +++ b/scripts/install @@ -180,7 +180,7 @@ chown -R $app: /etc/wireguard #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add wireguard@wg0 --description="WireGuard VPN" --needs_exposed_ports="$port_wg" --test_status="wg show | grep wg0" +yunohost service add wg-quick@wg0 --description="WireGuard VPN" --needs_exposed_ports="$port_wg" --test_status="wg show | grep wg0" yunohost service add wireguard_ui --description="WireGuard UI" #================================================= diff --git a/scripts/remove b/scripts/remove index 3c35861..4d9d468 100644 --- a/scripts/remove +++ b/scripts/remove @@ -35,10 +35,10 @@ then yunohost service remove wireguard_ui fi -if ynh_exec_warn_less yunohost service status wireguard@wg0 >/dev/null +if ynh_exec_warn_less yunohost service status wg-quick@wg0 >/dev/null then ynh_script_progression --message="Removing WireGuard service integration..." --weight=1 - yunohost service remove wireguard@wg0 + yunohost service remove wg-quick@wg0 fi #================================================= diff --git a/scripts/restore b/scripts/restore index e66d9da..cf7bda3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -132,7 +132,7 @@ sysctl -p /etc/sysctl.d/$app.conf #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add wireguard@wg0 --description="WireGuard VPN" --needs_exposed_ports="$port_wg" --test_status="wg show | grep wg0" +yunohost service add wg-quick@wg0 --description="WireGuard VPN" --needs_exposed_ports="$port_wg" --test_status="wg show | grep wg0" yunohost service add wireguard_ui --description="WireGuard UI" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 480b2ac..249fbe6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -107,6 +107,12 @@ if systemctl list-units --full -all | grep -Fq "wireguard_ui_conf.service"; then ynh_secure_remove --file="/etc/systemd/system/wireguard_ui_conf.service" fi +# Remove the service integration from an older version +if ynh_exec_warn_less yunohost service status wireguard@wg0 >/dev/null +then + yunohost service remove wireguard@wg0 +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -115,7 +121,7 @@ fi ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=wireguard_ui --action="stop" --line_match="Stopped WireGuard UI" --log_path="systemd" --timeout=30 -ynh_systemd_action --service_name=wireguard@wg0 --action="stop" +ynh_systemd_action --service_name=wg-quick@wg0 --action="stop" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -220,7 +226,7 @@ chown -R $app: /etc/wireguard #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add wireguard@wg0 --description="WireGuard VPN" --needs_exposed_ports="$port_wg" --test_status="wg show | grep wg0" +yunohost service add wg-quick@wg0 --description="WireGuard VPN" --needs_exposed_ports="$port_wg" --test_status="wg show | grep wg0" yunohost service add wireguard_ui --description="WireGuard UI" #=================================================