From 3c62cb367f0ac81fe6b4ed4b2da3f324af7b2056 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Wed, 10 Feb 2021 17:50:01 +0100 Subject: [PATCH] smaller improvements --- lib/osinfo.js | 2 +- lib/system.js | 4 ++++ lib/wifi.js | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/osinfo.js b/lib/osinfo.js index fad42e6..eb887f1 100644 --- a/lib/osinfo.js +++ b/lib/osinfo.js @@ -970,7 +970,7 @@ function versions(apps, callback) { if (_windows) { util.powerShell('$PSVersionTable').then(stdout => { const lines = stdout.toString().split('\n').map(line => line.replace(/ +/g, ' ').replace(/ +/g, ':')); - appsObj.versions.powershell = util.getVersion(lines, 'psversion'); + appsObj.versions.powershell = util.getValue(lines, 'psversion'); functionProcessed(); }); } else { diff --git a/lib/system.js b/lib/system.js index e4b4901..c73dec9 100644 --- a/lib/system.js +++ b/lib/system.js @@ -814,6 +814,10 @@ function chassis(callback) { result.serial = util.getValue(lines, 'serialnumber', '='); result.assetTag = util.getValue(lines, 'partnumber', '='); result.sku = util.getValue(lines, 'sku', '='); + if (result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) { result.manufacturer = '-'; } + if (result.version.toLowerCase().indexOf('o.e.m.') !== -1) { result.version = '-'; } + if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; } + if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; } } if (callback) { callback(result); } diff --git a/lib/wifi.js b/lib/wifi.js index 8b52cfb..e7e4969 100644 --- a/lib/wifi.js +++ b/lib/wifi.js @@ -579,7 +579,7 @@ function wifiConnections(callback) { const type = util.getValue(lines, 'Radio type', ':', true) || util.getValue(lines, 'Type de radio', ':', true) || util.getValue(lines, 'Funktyp', ':', true) || null; const security = util.getValue(lines, 'authentication', ':', true) || util.getValue(lines, 'Authentification', ':', true) || util.getValue(lines, 'Authentifizierung', ':', true) || null; const channel = util.getValue(lines, 'Channel', ':', true) || util.getValue(lines, 'Canal', ':', true) || util.getValue(lines, 'Kanal', ':', true) || null; - const txRate = util.getValue(lines, 'Transmit rate (mbps)', ':', true) || util.getValue(lines, 'Transmission (mbit/s)', ':', true) || util.getValue(lines, 'Übertragungsrate (MBit/s)', ':', true) || null; + const txRate = util.getValue(lines, 'Transmit rate (mbps)', ':', true) || util.getValue(lines, 'Transmission (mbit/s)', ':', true) || util.getValue(lines, 'Empfangsrate (MBit/s)', ':', true) || null; if (model && id && ssid && bssid) { result.push({ id, @@ -592,7 +592,7 @@ function wifiConnections(callback) { type, security, signalLevel, - txRate + txRate: util.toInt(txRate) || null }); } } @@ -669,7 +669,9 @@ function wifiInterfaces(callback) { const iface = lines[0].indexOf(':') >= 0 ? lines[0].split(':')[1].trim() : ''; const model = lines[1].indexOf(':') >= 0 ? lines[1].split(':')[1].trim() : ''; const id = lines[2].indexOf(':') >= 0 ? lines[2].split(':')[1].trim() : ''; - const mac = lines[3].indexOf(':') >= 0 ? lines[3].split(':')[1].trim() : ''; + const macParts = lines[3].indexOf(':') >= 0 ? lines[3].split(':') : []; + macParts.shift(); + const mac = macParts.join(':').trim(); const vendor = getVendor(model); if (iface && model && id && mac) { result.push({