Skip to content

Commit c1d26c9

Browse files
system() added uuid freebsd
1 parent 39db1b6 commit c1d26c9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/system.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ function system(callback) {
120120
util.noop();
121121
}
122122
}
123+
if (!result.uuid && (_freebsd || _openbsd || _netbsd)) {
124+
try {
125+
const disksById = execSync('sysctl -i kern.hostid kern.hostuuid', util.execOptsLinux).toString();
126+
result.uuid = util.getValue(lines, 'kern.hostid', ':').toLowerCase();
127+
} catch (e) {
128+
util.noop();
129+
}
130+
}
123131
if (!result.virtual && (os.release().toLowerCase().indexOf('microsoft') >= 0 || os.release().toLowerCase().endsWith('wsl2'))) {
124132
const kernelVersion = parseFloat(os.release().toLowerCase());
125133
result.virtual = true;

0 commit comments

Comments
 (0)