1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00

net/wireguard: Improve rc.d script to support other userspace implementations like boringtun

This commit is contained in:
Bernhard Froehlich 2019-03-29 12:27:08 +00:00
parent 6248a7aaea
commit 5b5493b8c0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=497111
2 changed files with 8 additions and 1 deletions

View File

@ -2,7 +2,7 @@
PORTNAME= wireguard
PORTVERSION= 0.0.20190227
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= net
MASTER_SITES= https://git.zx2c4.com/WireGuard/snapshot/
DISTNAME= WireGuard-${PORTVERSION}

View File

@ -12,6 +12,10 @@
# wireguard_interfaces (str): List of interfaces to bring up/down
# on start/stop. (eg: "wg0 wg1")
# (default: "")
# wireguard_impl (str): Wireguard userspace implementation
# (default: "wireguard-go")
# Possible choices:
# wireguard-go, boringtun
. /etc/rc.subr
@ -23,6 +27,8 @@ stop_cmd="${name}_stop"
wireguard_start()
{
export WG_QUICK_USERSPACE_IMPLEMENTATION=${wireguard_impl}
for interface in ${wireguard_interfaces}; do
%%PREFIX%%/bin/wg-quick up ${interface}
done
@ -39,5 +45,6 @@ load_rc_config $name
: ${wireguard_enable="NO"}
: ${wireguard_interfaces=""}
: ${wireguard_impl="wireguard-go"}
run_rc_command "$1"