From 6f0c56c4c1ab74c0556f5f919755cb97a972192a Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Thu, 19 Jun 2025 15:01:38 +0200 Subject: [PATCH] system() added model freebsd --- lib/system.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/system.js b/lib/system.js index bdb1b6b..2eebd71 100644 --- a/lib/system.js +++ b/lib/system.js @@ -16,6 +16,7 @@ const fs = require('fs'); const os = require('os'); const util = require('./util'); +const { uuid } = require('./osinfo'); const exec = require('child_process').exec; const execSync = require('child_process').execSync; const execPromise = util.promisify(require('child_process').exec); @@ -120,13 +121,18 @@ function system(callback) { util.noop(); } } - if (!result.uuid && (_freebsd || _openbsd || _netbsd)) { + if (_freebsd || _openbsd || _netbsd) { try { - const lines = execSync('sysctl -i kern.hostuuid kern.hostid', util.execOptsLinux).toString().split('\n'); - result.uuid = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase(); + const lines = execSync('sysctl -i kern.hostuuid kern.hostid hw.model', util.execOptsLinux).toString().split('\n'); + if (!result.uuid) { + result.uuid = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase(); + } if (!result.serial || result.serial === '-') { result.serial = util.getValue(lines, 'kern.hostid', ':').toLowerCase(); } + if (!result.model || result.model === 'Computer') { + result.model = util.getValue(lines, 'hw.model', ':').trim(); + } } catch (e) { util.noop(); }