From 46664bc0b0b89b95ad687162b6ad834331ffc75c Mon Sep 17 00:00:00 2001 From: "Philip H." <47042125+pheiduck@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:41:57 +0000 Subject: [PATCH] Invoking wireguard-go wg0 --- src/lib/WireGuard.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 1d432a30..5e608d83 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -60,9 +60,9 @@ module.exports = class WireGuard { await this.__saveConfig(config); await Util.exec('wg-quick down wg0').catch(() => { }); - await Util.exec('wg-quick up wg0').catch((err) => { - if (err && err.message && err.message.includes('Cannot find device "wg0"')) { - throw new Error('WireGuard exited with the error: Cannot find device "wg0"\nThis usually means that your host\'s kernel does not support WireGuard!'); + await Util.exec('wg-quick up wg0').catch(async (err) => { + if (err && err.message && err.message.includes('Cannot find device "wg0"\nInvoke "wireguard-go" for creating "wg0"')) { + await Util.exec('wireguard-go wg0').catch(() => { }); } throw err;