fix(core): update

This commit is contained in:
2019-09-08 16:15:10 +02:00
parent 34bee225d5
commit 8d1b302e70
5 changed files with 26 additions and 4 deletions

View File

@ -133,4 +133,14 @@ export class SmartNetwork {
const result = plugins.os.networkInterfaces();
return result;
}
public async getDefaultGateway(): Promise<{ipv4: plugins.os.NetworkInterfaceInfo, ipv6: plugins.os.NetworkInterfaceInfo}> {
const defaultGatewayName = await plugins.systeminformation.networkInterfaceDefault();
const gateways = await this.getGateways();
const defaultGateway = gateways[defaultGatewayName];
return {
ipv4: defaultGateway[0],
ipv6: defaultGateway[1]
};
}
}