bsd fixes
This commit is contained in:
parent
c88315a504
commit
44744b77cd
@ -760,12 +760,12 @@ function graphics(callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_freebsd || _openbsd || _netbsd) {
|
if (_freebsd || _openbsd || _netbsd) {
|
||||||
if (callback) { callback(result); }
|
if (callback) { callback(null); }
|
||||||
resolve(result);
|
resolve(null);
|
||||||
}
|
}
|
||||||
if (_sunos) {
|
if (_sunos) {
|
||||||
if (callback) { callback(result); }
|
if (callback) { callback(null); }
|
||||||
resolve(result);
|
resolve(null);
|
||||||
}
|
}
|
||||||
if (_windows) {
|
if (_windows) {
|
||||||
|
|
||||||
|
|||||||
@ -1020,7 +1020,7 @@ function processLoad(proc, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_darwin || _linux) {
|
if (_darwin || _linux || _freebsd || _openbsd || _netbsd) {
|
||||||
const params = '-axo pid,pcpu,pmem,comm';
|
const params = '-axo pid,pcpu,pmem,comm';
|
||||||
execFile('ps', params.split(' '), { maxBuffer: 1024 * 20000 }, function (error, stdout) {
|
execFile('ps', params.split(' '), { maxBuffer: 1024 * 20000 }, function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
|||||||
@ -120,6 +120,29 @@ function system(callback) {
|
|||||||
util.noop();
|
util.noop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ((_freebsd || _openbsd || _netbsd) && !result.virtualHost) {
|
||||||
|
try {
|
||||||
|
const procInfo = execSync('dmidecode -t 4');
|
||||||
|
const procLines = procInfo.toString().split('\n');
|
||||||
|
const procManufacturer = util.getValue(procLines, 'manufacturer', ':', true);
|
||||||
|
switch (procManufacturer.toLowerCase()) {
|
||||||
|
case 'virtualbox':
|
||||||
|
result.virtualHost = 'VirtualBox';
|
||||||
|
break;
|
||||||
|
case 'vmware':
|
||||||
|
result.virtualHost = 'VMware';
|
||||||
|
break;
|
||||||
|
case 'kvm':
|
||||||
|
result.virtualHost = 'KVM';
|
||||||
|
break;
|
||||||
|
case 'bochs':
|
||||||
|
result.virtualHost = 'bochs';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
util.noop();
|
||||||
|
}
|
||||||
|
}
|
||||||
// detect docker
|
// detect docker
|
||||||
if (fs.existsSync('/.dockerenv') || fs.existsSync('/.dockerinit')) {
|
if (fs.existsSync('/.dockerenv') || fs.existsSync('/.dockerinit')) {
|
||||||
result.model = 'Docker Container';
|
result.model = 'Docker Container';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user