From ec40b5a473af347a67ff672c3178a3e670d95951 Mon Sep 17 00:00:00 2001 From: Julien Escario Date: Wed, 16 Sep 2020 14:52:22 +0200 Subject: [PATCH] Added wireguard module detection --- wireguard/deploy-wg-clients.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wireguard/deploy-wg-clients.sh b/wireguard/deploy-wg-clients.sh index 04f7ba6..9f1eb5b 100755 --- a/wireguard/deploy-wg-clients.sh +++ b/wireguard/deploy-wg-clients.sh @@ -9,6 +9,11 @@ if ! [[ $IP =~ ^[0-9]{1,3}$ ]] ; then echo "error: Please set IP variable (with IP=1-254. See https://phpipam.altinea.fr" >&2; exit 1 fi +if ! modprobe -q wireguard ; then + echo "Wireguard support missing. You should probably play with kernel headers and wireguard-dkms package" + exit 1 +fi + # Create keys subdir, generate private and derive public key mkdir -p /etc/wireguard/keys umask 077 && wg genkey > /etc/wireguard/keys/private.key && wg pubkey < /etc/wireguard/keys/private.key > /etc/wireguard/keys/public.key && umask 0022