Date: Mon, 30 Mar 2020 19:18:03 +0000 (UTC) From: Bernhard Froehlich <decke@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r529909 - in head/net/wireguard: . files Message-ID: <202003301918.02UJI30h038282@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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 }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003301918.02UJI30h038282>