1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

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
This commit is contained in:
Bernhard Froehlich 2020-03-30 19:18:03 +00:00
parent fc03a6d789
commit affd3bad7d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=529909
2 changed files with 15 additions and 1 deletions

View File

@ -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}

View File

@ -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()
{
@ -39,6 +41,18 @@ wireguard_stop()
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
}
load_rc_config $name
: ${wireguard_enable="NO"}