uuid() fixed os, hardware uuids (freebsd)

This commit is contained in:
Sebastian Hildebrandt
2025-06-19 08:44:11 +02:00
parent a1fade8ae5
commit 1e3591a417
4 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -1240,8 +1240,8 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`;
if (_freebsd || _openbsd || _netbsd) {
exec('sysctl -i kern.hostid kern.hostuuid', function (error, stdout) {
const lines = stdout.toString().split('\n');
result.os = util.getValue(lines, 'kern.hostid', ':').toLowerCase();
result.hardware = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase();
result.hardware = util.getValue(lines, 'kern.hostid', ':').toLowerCase();
result.os = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase();
if (result.os.indexOf('unknown') >= 0) { result.os = ''; }
if (result.hardware.indexOf('unknown') >= 0) { result.hardware = ''; }
if (callback) {