wg-quick: freebsd: avoid writing private keys to /tmp

FreeBSD's bash doesn't handle <(...) safely, creating a temporary file
instead of using /proc/self/fd/N like on Linux. Work around this by
using a simple pipeline with /dev/stdin.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2021-03-13 21:20:19 -07:00
parent 4e4867dc95
commit 9c811e0f2d

View file

@ -349,7 +349,7 @@ add_route() {
}
set_config() {
cmd wg setconf "$INTERFACE" <(echo "$WG_CONFIG")
echo "$WG_CONFIG" | cmd wg setconf "$INTERFACE" /dev/stdin
}
save_config() {