Compare commits

...

2 Commits

Author SHA1 Message Date
ad0fa8c65a 1.1.14 2019-09-08 16:24:59 +02:00
88a9bfc20d fix(core): update 2019-09-08 16:24:59 +02:00
3 changed files with 6 additions and 2 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartnetwork",
"version": "1.1.13",
"version": "1.1.14",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartnetwork",
"version": "1.1.13",
"version": "1.1.14",
"private": false,
"description": "network diagnostics",
"main": "dist/index.js",

View File

@ -136,6 +136,10 @@ export class SmartNetwork {
public async getDefaultGateway(): Promise<{ipv4: plugins.os.NetworkInterfaceInfo, ipv6: plugins.os.NetworkInterfaceInfo}> {
const defaultGatewayName = await plugins.systeminformation.networkInterfaceDefault();
if (!defaultGatewayName) {
console.log('Cannot determine default gateway');
return null;
}
const gateways = await this.getGateways();
const defaultGateway = gateways[defaultGatewayName];
return {