From 3bc766474826805e8cc8ccc9279fa8ba9d125647 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Thu, 9 May 2019 10:25:53 +0200 Subject: [PATCH] networkInterfaceDefault() time delay fix (linux) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/network.js | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eb2c12..9525cd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.2.1 | 2019-05-09 | `networkInterfaceDefault()` time delay fix (linux) | | 4.2.0 | 2019-05-09 | `osInfo()` extended service pack version (windows) | | 4.1.8 | 2019-05-09 | `graphics()` resolve on error (windows) | | 4.1.7 | 2019-05-09 | `users()` parsing fix (windows) | diff --git a/docs/history.html b/docs/history.html index 187f0b3..2644909 100644 --- a/docs/history.html +++ b/docs/history.html @@ -80,6 +80,11 @@ + + 4.2.1 + 2019-05-09 + networkInterfaceDefault() time delay fix (linux) + 4.2.0 2019-05-09 diff --git a/docs/index.html b/docs/index.html index d782e5e..6c1a08a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
-
Current Version: 4.2.0
+
Current Version: 4.2.1
diff --git a/lib/network.js b/lib/network.js index 4e0fc29..4aac4db 100644 --- a/lib/network.js +++ b/lib/network.js @@ -60,7 +60,7 @@ function getDefaultNetworkInterface() { ifacename = ifacename || ifacenameFirst || ''; if (_linux || _darwin || _freebsd || _openbsd || _sunos) { let cmd = ''; - if (_linux) cmd = 'route 2>/dev/null | grep default | awk \'{print $8}\''; + if (_linux) cmd = 'ip route 2> /dev/null | grep default | awk \'{print $5}\''; if (_darwin) cmd = 'route get 0.0.0.0 2>/dev/null | grep interface: | awk \'{print $2}\''; if (_freebsd || _openbsd || _sunos) cmd = 'route get 0.0.0.0 | grep interface:'; let result = execSync(cmd);