mirror of https://github.com/wg-easy/wg-easy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
672 B
29 lines
672 B
'use strict';
|
|
|
|
require('./services/Server');
|
|
|
|
const WireGuard = require('./services/WireGuard');
|
|
|
|
WireGuard.getConfig()
|
|
.catch((err) => {
|
|
// eslint-disable-next-line no-console
|
|
console.error(err);
|
|
|
|
// eslint-disable-next-line no-process-exit
|
|
process.exit(1);
|
|
});
|
|
|
|
// Handle terminate signal
|
|
process.on('SIGTERM', async () => {
|
|
// eslint-disable-next-line no-console
|
|
console.log('SIGTERM signal received.');
|
|
await WireGuard.Shutdown();
|
|
// eslint-disable-next-line no-process-exit
|
|
process.exit(0);
|
|
});
|
|
|
|
// Handle interrupt signal
|
|
process.on('SIGINT', () => {
|
|
// eslint-disable-next-line no-console
|
|
console.log('SIGINT signal received.');
|
|
});
|
|
|