From 724d979a41e9a96b27c16e522929c3f918f46a79 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 5 May 2018 03:54:55 +0200 Subject: wg-quick: preliminary support for go implementation --- src/tools/wg-quick.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash index f8c1ce7..cd66b4d 100755 --- a/src/tools/wg-quick.bash +++ b/src/tools/wg-quick.bash @@ -83,7 +83,13 @@ auto_su() { } add_if() { - cmd ip link add "$INTERFACE" type wireguard + local ret + if ! cmd ip link add "$INTERFACE" type wireguard; then + ret=$? + [[ -e /sys/module/wireguard ]] || ! command -v wireguard-go >/dev/null && return $ret + echo "[!] Missing WireGuard kernel module. Falling back to slow userspace implementation." + cmd wireguard-go "$INTERFACE" + fi } del_if() { -- cgit v1.2.3-59-g8ed1b