format code

This commit is contained in:
Bernd Storath
2025-11-14 15:41:48 +01:00
parent fbf24410db
commit 993c130f65
9 changed files with 102 additions and 37 deletions
+9 -3
View File
@@ -228,14 +228,18 @@ class WireGuard {
const wgInterfaceWithOverrides = applyInterfaceOverrides(wgInterface);
WG_DEBUG(`Starting Wireguard Interface ${wgInterfaceWithOverrides.name}...`);
WG_DEBUG(
`Starting Wireguard Interface ${wgInterfaceWithOverrides.name}...`
);
await this.#saveWireguardConfig(wgInterfaceWithOverrides);
await wg.down(wgInterfaceWithOverrides.name).catch(() => {});
await wg.up(wgInterfaceWithOverrides.name).catch((err) => {
if (
err &&
err.message &&
err.message.includes(`Cannot find device "${wgInterfaceWithOverrides.name}"`)
err.message.includes(
`Cannot find device "${wgInterfaceWithOverrides.name}"`
)
) {
throw new Error(
`WireGuard exited with the error: Cannot find device "${wgInterfaceWithOverrides.name}"\nThis usually means that your host's kernel does not support WireGuard!`,
@@ -246,7 +250,9 @@ class WireGuard {
throw err;
});
await this.#syncWireguardConfig(wgInterfaceWithOverrides);
WG_DEBUG(`Wireguard Interface ${wgInterfaceWithOverrides.name} started successfully.`);
WG_DEBUG(
`Wireguard Interface ${wgInterfaceWithOverrides.name} started successfully.`
);
WG_DEBUG('Starting Cron Job...');
await this.startCronJob();