Browse Source

fixup: lint errors

pull/879/head
Chanchai 2 years ago
parent
commit
75d9a199f6
  1. 3
      src/lib/WireGuard.js
  2. 7
      src/server.js

3
src/lib/WireGuard.js

@ -322,4 +322,5 @@ Endpoint = ${WG_HOST}:${WG_PORT}`;
async Shutdown() { async Shutdown() {
await Util.exec('wg-quick down wg0').catch(() => { }); await Util.exec('wg-quick down wg0').catch(() => { });
} }
};
};

7
src/server.js

@ -14,13 +14,16 @@ WireGuard.getConfig()
}); });
// Handle terminate signal // Handle terminate signal
process.on('SIGTERM', async() => { process.on('SIGTERM', async () => {
// eslint-disable-next-line no-console
console.log('SIGTERM signal received.'); console.log('SIGTERM signal received.');
await WireGuard.Shutdown(); await WireGuard.Shutdown();
// eslint-disable-next-line no-process-exit
process.exit(0); process.exit(0);
}); });
// Handle interupt signal // Handle interrupt signal
process.on('SIGINT', () => { process.on('SIGINT', () => {
// eslint-disable-next-line no-console
console.log('SIGINT signal received.'); console.log('SIGINT signal received.');
}); });
Loading…
Cancel
Save