From eccebb1e7fa6563f26177443c1a08aa64eb9dae3 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Mon, 21 Nov 2022 11:24:55 +0100 Subject: [PATCH] osInfo() improved uefi parsing (FreeBSD) --- CHANGELOG.md | 3 ++- docs/history.html | 5 +++++ docs/index.html | 2 +- lib/internet.js | 2 +- lib/osinfo.js | 4 +++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a730d12..3ec3f4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,7 +82,8 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | -| 5.14.3 | 2022-11-21 | `graphics()` multi monitor refresh rate (windows) | +| 5.14.4 | 2022-11-21 | `osInfo()` improved uefi parsing (FreeBSD) | +| 5.14.3 | 2022-11-20 | `graphics()` multi monitor refresh rate (windows) | | 5.14.2 | 2022-11-20 | `osInfo()` improved parsing (FreeBSD) | | 5.14.1 | 2022-11-20 | `memLayout()` bank descriptor cleanup (linux) | | 5.14.0 | 2022-11-19 | `blockDevices()` added raid group member (linux) | diff --git a/docs/history.html b/docs/history.html index 615d364..b48030b 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.14.4 + 2022-11-21 + osInfo() improved uefi parsing (FreeBSD) + 5.14.3 2022-11-20 diff --git a/docs/index.html b/docs/index.html index 88f1a1c..c6e3f8f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.14.3
+
New Version: 5.14.4
diff --git a/lib/internet.js b/lib/internet.js index 5abf1c0..8d2c497 100644 --- a/lib/internet.js +++ b/lib/internet.js @@ -46,7 +46,7 @@ function inetChecksite(url, callback) { let urlSanitized = ''; const s = util.sanitizeShellString(url, true); for (let i = 0; i <= util.mathMin(s.length, 2000); i++) { - if (!s[i] !== undefined) { + if (s[i] !== undefined) { s[i].__proto__.toLowerCase = util.stringToLower; const sl = s[i].toLowerCase(); if (sl && sl[0] && !sl[1] && sl[0].length === 1) { diff --git a/lib/osinfo.js b/lib/osinfo.js index d4456ca..0c30cf0 100644 --- a/lib/osinfo.js +++ b/lib/osinfo.js @@ -268,7 +268,9 @@ function osInfo(callback) { const logofile = util.getValue(lines, 'kern.ostype'); const release = util.getValue(lines, 'kern.osrelease').split('-')[0]; const serial = util.getValue(lines, 'kern.uuid'); - const uefi = util.getValue(lines, 'machdep.bootmethod').toLowerCase().indexOf('uefi') >= 0; + const bootmethod = util.getValue(lines, 'machdep.bootmethod'); + const uefiConf = stdout.toString().indexOf('efi') >= 0; + const uefi = bootmethod ? bootmethod.toLowerCase().indexOf('uefi') >= 0 : (uefiConf ? uefiConf : null); result.distro = distro || result.distro; result.logofile = logofile || result.logofile; result.release = release || result.release;