osInfo() improved uefi parsing (FreeBSD)

This commit is contained in:
Sebastian Hildebrandt
2022-11-21 11:24:55 +01:00
parent d0cc0254db
commit eccebb1e7f
5 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -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) {
+3 -1
View File
@@ -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('<type>efi</type>') >= 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;