This commit is contained in:
Emile Nijssen 2021-05-23 12:25:14 +02:00
parent 9c34761578
commit e3b7d94fa0
7 changed files with 59 additions and 4 deletions

View file

@ -22,6 +22,10 @@ module.exports = class WireGuard {
async getConfig() {
if (!this.__configPromise) {
this.__configPromise = Promise.resolve().then(async () => {
if (!WG_HOST) {
throw new Error('WG_HOST Environment Variable Not Set!');
}
let config;
try {
config = await fs.readFile(path.join(WG_PATH, 'wg0.json'), 'utf8');