diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 7886ac9..fd19458 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -60,7 +60,7 @@ 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 => { + 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!'); } @@ -156,7 +156,7 @@ AllowedIPs = ${client.address}/32`; .trim() .split('\n') .slice(1) - .forEach(line => { + .forEach((line) => { const [ publicKey, preSharedKey, // eslint-disable-line no-unused-vars @@ -168,7 +168,7 @@ AllowedIPs = ${client.address}/32`; persistentKeepalive, ] = line.split('\t'); - const client = clients.find(client => client.publicKey === publicKey); + const client = clients.find((client) => client.publicKey === publicKey); if (!client) return; client.latestHandshakeAt = latestHandshakeAt === '0' @@ -233,7 +233,7 @@ Endpoint = ${WG_HOST}:${WG_PORT}`; // Calculate next IP let address; for (let i = 2; i < 255; i++) { - const client = Object.values(config.clients).find(client => { + const client = Object.values(config.clients).find((client) => { return client.address === WG_DEFAULT_ADDRESS.replace('x', i); });