#!/bin/bash -e . .env export iface; iface="$(ip route show default | grep -Po 'dev\s+\K\w+')" export privkey; privkey="$(wg genkey)" envsubst < nftables.conf > /etc/wireguard/nftables.conf envsubst < wg0.conf > /etc/wireguard/wg0.conf systemctl enable wg-quick@wg0