From 50f6458561b1f0d94e69b1c8867101dba38549d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Molinero=20Fern=C3=A1ndez?= Date: Sun, 21 Nov 2021 14:23:14 +0100 Subject: [PATCH] Don't invoke a subshell --- packer/rootfs/etc/wireguard/wg0.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packer/rootfs/etc/wireguard/wg0.conf b/packer/rootfs/etc/wireguard/wg0.conf index e328ba8..280fb0f 100644 --- a/packer/rootfs/etc/wireguard/wg0.conf +++ b/packer/rootfs/etc/wireguard/wg0.conf @@ -2,11 +2,11 @@ Address = 10.10.10.1/24, fd10:10:10::1/64 ListenPort = 51820 # Load keys -PostUp = [ -s '/etc/wireguard/%i-privatekey' ] || (umask 077 && wg genkey > '/etc/wireguard/%i-privatekey') -PostUp = [ -s '/etc/wireguard/%i-publickey' ] || (umask 022 && wg pubkey < '/etc/wireguard/%i-privatekey' > '/etc/wireguard/%i-publickey') +PostUp = [ -s '/etc/wireguard/%i-privatekey' ] || { umask 077 && wg genkey > '/etc/wireguard/%i-privatekey'; } +PostUp = [ -s '/etc/wireguard/%i-publickey' ] || { umask 022 && wg pubkey < '/etc/wireguard/%i-privatekey' > '/etc/wireguard/%i-publickey'; } PostUp = wg set '%i' private-key '/etc/wireguard/%i-privatekey' # Load peers -PostUp = [ -e '/etc/wireguard/%i-peers.conf' ] || (umask 022 && touch '/etc/wireguard/%i-peers.conf') +PostUp = [ -e '/etc/wireguard/%i-peers.conf' ] || { umask 022 && touch '/etc/wireguard/%i-peers.conf'; } PostUp = wg addconf '%i' '/etc/wireguard/%i-peers.conf' # Reload nftables PostUp = nft -f /etc/nftables.conf