tiny fixes system.model, getDefaultNetworkInterface
This commit is contained in:
parent
e9a5443a81
commit
7a8ed92cd0
@ -377,7 +377,8 @@ I am happy to discuss any comments and suggestions. Please feel free to contact
|
||||
|
||||
| Version | Date | Comment |
|
||||
| -------------- | -------------- | -------- |
|
||||
| 3.4.3 | 2016-09-02 | tiny bug fix fsStats, DisksIO OSX |
|
||||
| 3.4.4 | 2016-09-02 | tiny fixes system.model, getDefaultNetworkInterface |
|
||||
| 3.4.3 | 2016-09-02 | tiny bug fix fsStats, disksIO OSX |
|
||||
| 3.4.2 | 2016-09-01 | improved default network interface |
|
||||
| 3.4.1 | 2016-08-30 | updated docs |
|
||||
| 3.4.0 | 2016-08-30 | rewritten processes current cpu usage |
|
||||
|
||||
10
lib/index.js
10
lib/index.js
@ -80,7 +80,8 @@
|
||||
// --------------------------------
|
||||
//
|
||||
// version date comment
|
||||
// 3.4.3 2016-09-02 tiny bug fix fsStats, DisksIO OSX
|
||||
// 3.4.4 2016-09-02 tiny fixes system.model, getDefaultNetworkInterface
|
||||
// 3.4.3 2016-09-02 tiny bug fix fsStats, disksIO OSX
|
||||
// 3.4.2 2016-09-01 improved default network interface
|
||||
// 3.4.1 2016-08-30 updated docs
|
||||
// 3.4.0 2016-08-30 rewritten current process cpu usage (linux)
|
||||
@ -198,8 +199,11 @@ function system(callback) {
|
||||
}
|
||||
});
|
||||
if (result.serial.toLowerCase().indexOf('o.e.m.') != -1) result.serial = '-';
|
||||
if (result.manufacturer.toLowerCase().indexOf('o.e.m.') != -1) result.manufacturer = '';
|
||||
if (result.model.toLowerCase().indexOf('o.e.m.') != -1) result.model = 'Computer';
|
||||
if (result.version.toLowerCase().indexOf('o.e.m.') != -1) result.version = '-';
|
||||
|
||||
if (result.manufacturer == '-' && result.model == '-' && result.version == '-') {
|
||||
if (result.manufacturer == '' && result.model == 'Computer' && result.version == '-') {
|
||||
// Check Raspberry Pi
|
||||
exec("grep Hardware /proc/cpuinfo; grep Serial /proc/cpuinfo; grep Revision /proc/cpuinfo", function (error, stdout) {
|
||||
if (!error) {
|
||||
@ -1168,7 +1172,7 @@ exports.disksIO = disksIO;
|
||||
function getDefaultNetworkInterface() {
|
||||
|
||||
let ifacename = '';
|
||||
let cmd = (_linux ? "route | grep default | awk '{print $8}'" : "route get 0.0.0.0 2>/dev/null | grep interface: | awk '{print $2}'");
|
||||
let cmd = (_linux ? "route 2>/dev/null | grep default | awk '{print $8}'" : "route get 0.0.0.0 2>/dev/null | grep interface: | awk '{print $2}'");
|
||||
let result = execSync(cmd);
|
||||
ifacename = result.toString().split('\n')[0];
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user