forked from mirrors/amnezia-wg-easy
wip
This commit is contained in:
parent
9c34761578
commit
e3b7d94fa0
7 changed files with 59 additions and 4 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue