svn commit: r529909 - in head/net/wireguard: . files
Bernhard Froehlich
decke at FreeBSD.org
Mon Mar 30 19:18:13 UTC 2020
Author: decke
Date: Mon Mar 30 19:18:03 2020
New Revision: 529909
URL: https://svnweb.freebsd.org/changeset/ports/529909
Log:
net/wireguard: Implement reload command in rc.d script to reload all peer
and key settings without restarting the daemon to avoid interface up/down
and loosing traffic. This does not work if you change the Address= line in
the [Interface] section which needs a real restart.
PR: 244862
Submitted by: david at isnic.is
Modified:
head/net/wireguard/Makefile
head/net/wireguard/files/wireguard.in
Modified: head/net/wireguard/Makefile
==============================================================================
--- head/net/wireguard/Makefile Mon Mar 30 19:15:32 2020 (r529908)
+++ head/net/wireguard/Makefile Mon Mar 30 19:18:03 2020 (r529909)
@@ -2,7 +2,7 @@
PORTNAME= wireguard
PORTVERSION= 1.0.20200319
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net net-vpn
MASTER_SITES= https://git.zx2c4.com/wireguard-tools/snapshot/
DISTNAME= wireguard-tools-${PORTVERSION}
Modified: head/net/wireguard/files/wireguard.in
==============================================================================
--- head/net/wireguard/files/wireguard.in Mon Mar 30 19:15:32 2020 (r529908)
+++ head/net/wireguard/files/wireguard.in Mon Mar 30 19:18:03 2020 (r529909)
@@ -19,9 +19,11 @@
name=wireguard
rcvar=wireguard_enable
+extra_commands="reload"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
+reload_cmd="${name}_reload"
wireguard_start()
{
@@ -36,6 +38,18 @@ wireguard_stop()
{
for interface in ${wireguard_interfaces}; do
%%PREFIX%%/bin/wg-quick down ${interface}
+ done
+}
+
+wireguard_reload()
+{
+ ${wireguard_env:+eval export $wireguard_env}
+
+ for interface in ${wireguard_interfaces}; do
+ tmpfile="`mktemp`"
+ %%PREFIX%%/bin/wg-quick strip ${interface} > ${tmpfile}
+ %%PREFIX%%/bin/wg syncconf ${interface} ${tmpfile}
+ rm -f ${tmpfile}
done
}
More information about the svn-ports-all
mailing list