systeminformation 5.27.4 → 5.27.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/system.js +19 -2
- package/package.json +1 -1
package/lib/system.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
const fs = require('fs');
|
|
17
17
|
const os = require('os');
|
|
18
18
|
const util = require('./util');
|
|
19
|
+
const { uuid } = require('./osinfo');
|
|
19
20
|
const exec = require('child_process').exec;
|
|
20
21
|
const execSync = require('child_process').execSync;
|
|
21
22
|
const execPromise = util.promisify(require('child_process').exec);
|
|
@@ -107,8 +108,8 @@ function system(callback) {
|
|
|
107
108
|
}
|
|
108
109
|
if (!result.virtual) {
|
|
109
110
|
try {
|
|
110
|
-
const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null', util.execOptsLinux).toString();
|
|
111
|
-
if (disksById.indexOf('_QEMU_') >= 0) {
|
|
111
|
+
const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null; pciconf -lv 2>/dev/null', util.execOptsLinux).toString();
|
|
112
|
+
if (disksById.indexOf('_QEMU_') >= 0 || disksById.indexOf('QEMU ') >= 0) {
|
|
112
113
|
result.virtual = true;
|
|
113
114
|
result.virtualHost = 'QEMU';
|
|
114
115
|
}
|
|
@@ -120,6 +121,22 @@ function system(callback) {
|
|
|
120
121
|
util.noop();
|
|
121
122
|
}
|
|
122
123
|
}
|
|
124
|
+
if (_freebsd || _openbsd || _netbsd) {
|
|
125
|
+
try {
|
|
126
|
+
const lines = execSync('sysctl -i kern.hostuuid kern.hostid hw.model', util.execOptsLinux).toString().split('\n');
|
|
127
|
+
if (!result.uuid) {
|
|
128
|
+
result.uuid = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase();
|
|
129
|
+
}
|
|
130
|
+
if (!result.serial || result.serial === '-') {
|
|
131
|
+
result.serial = util.getValue(lines, 'kern.hostid', ':').toLowerCase();
|
|
132
|
+
}
|
|
133
|
+
if (!result.model || result.model === 'Computer') {
|
|
134
|
+
result.model = util.getValue(lines, 'hw.model', ':').trim();
|
|
135
|
+
}
|
|
136
|
+
} catch (e) {
|
|
137
|
+
util.noop();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
123
140
|
if (!result.virtual && (os.release().toLowerCase().indexOf('microsoft') >= 0 || os.release().toLowerCase().endsWith('wsl2'))) {
|
|
124
141
|
const kernelVersion = parseFloat(os.release().toLowerCase());
|
|
125
142
|
result.virtual = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.27.
|
|
3
|
+
"version": "5.27.6",
|
|
4
4
|
"description": "Advanced, lightweight system and OS information library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|