diff options
author | Bernhard Froehlich <decke@FreeBSD.org> | 2021-03-25 07:34:06 +0000 |
---|---|---|
committer | Bernhard Froehlich <decke@FreeBSD.org> | 2021-03-25 07:34:06 +0000 |
commit | 562d171b9dacad8f63e6e4a45035824b10b59341 (patch) | |
tree | 125ae36e5908b0a0133f6b67e92843ee2a5acd72 /net | |
parent | - update option CYRUSLOOKUP (diff) |
net/wireguard-tools: Unload if_wg kernel module after stop if it was loaded
This helps to reload also the kernel module after an update with a simple
restart or stop/start of the service.
Notes
Notes:
svn path=/head/; revision=569184
Diffstat (limited to 'net')
-rw-r--r-- | net/wireguard-tools/Makefile | 2 | ||||
-rw-r--r-- | net/wireguard-tools/files/wireguard_lite.in | 7 | ||||
-rw-r--r-- | net/wireguard-tools/files/wireguard_wgquick.in | 7 |
3 files changed, 15 insertions, 1 deletions
diff --git a/net/wireguard-tools/Makefile b/net/wireguard-tools/Makefile index 5191e24f469a..5896b9f8f919 100644 --- a/net/wireguard-tools/Makefile +++ b/net/wireguard-tools/Makefile @@ -2,7 +2,7 @@ PORTNAME= wireguard-tools PORTVERSION= 1.0.20210315 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net net-vpn MASTER_SITES= https://git.zx2c4.com/wireguard-tools/snapshot/ diff --git a/net/wireguard-tools/files/wireguard_lite.in b/net/wireguard-tools/files/wireguard_lite.in index 74b4556ad966..60106276b562 100644 --- a/net/wireguard-tools/files/wireguard_lite.in +++ b/net/wireguard-tools/files/wireguard_lite.in @@ -86,6 +86,13 @@ wireguard_stop() ifconfig ${interface} destroy done + + if kldstat -q -n if_wg; then + if ! kldunload if_wg > /dev/null 2>&1; then + warn "Can't unload if_wg module." + return 1 + fi + fi } wireguard_reload() diff --git a/net/wireguard-tools/files/wireguard_wgquick.in b/net/wireguard-tools/files/wireguard_wgquick.in index 3440f048dfab..adafc3041fb3 100644 --- a/net/wireguard-tools/files/wireguard_wgquick.in +++ b/net/wireguard-tools/files/wireguard_wgquick.in @@ -39,6 +39,13 @@ wireguard_stop() for interface in ${wireguard_interfaces}; do %%PREFIX%%/bin/wg-quick down ${interface} done + + if kldstat -q -n if_wg; then + if ! kldunload if_wg > /dev/null 2>&1; then + warn "Can't unload if_wg module." + return 1 + fi + fi } wireguard_reload() |