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