system() added uuid freebsd

This commit is contained in:
Sebastian Hildebrandt 2025-06-19 10:58:27 +02:00
parent 39db1b6f8a
commit c1d26c9a00

View File

@ -120,6 +120,14 @@ function system(callback) {
util.noop();
}
}
if (!result.uuid && (_freebsd || _openbsd || _netbsd)) {
try {
const disksById = execSync('sysctl -i kern.hostid kern.hostuuid', util.execOptsLinux).toString();
result.uuid = util.getValue(lines, 'kern.hostid', ':').toLowerCase();
} catch (e) {
util.noop();
}
}
if (!result.virtual && (os.release().toLowerCase().indexOf('microsoft') >= 0 || os.release().toLowerCase().endsWith('wsl2'))) {
const kernelVersion = parseFloat(os.release().toLowerCase());
result.virtual = true;