system() added uuid freebsd

This commit is contained in:
Sebastian Hildebrandt
2025-06-19 11:16:44 +02:00
parent e958beac95
commit ef5286e6cc
4 changed files with 11 additions and 2 deletions
+4 -1
View File
@@ -122,8 +122,11 @@ function system(callback) {
}
if (!result.uuid && (_freebsd || _openbsd || _netbsd)) {
try {
const lines = execSync('sysctl -i kern.hostuuid', util.execOptsLinux).toString().split('\n');
const lines = execSync('sysctl -i kern.hostuuid kern.hostid', util.execOptsLinux).toString().split('\n');
result.uuid = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase();
if (!result.serial) {
result.serial = util.getValue(lines, 'kern.hostid', ':').toLowerCase();
}
} catch (e) {
util.noop();
}