system() fix Raspberry Pi detection

This commit is contained in:
Sebastian Hildebrandt 2018-10-22 18:44:32 +02:00
parent dce83716c0
commit 880c5b5f30
2 changed files with 12 additions and 11 deletions

View File

@ -100,6 +100,7 @@ Other changes
| Version | Date | Comment | | Version | Date | Comment |
| -------------- | -------------- | -------- | | -------------- | -------------- | -------- |
| 3.45.8 | 2018-10-22 | `system()` fix Raspberry Pi detection |
| 3.45.7 | 2018-10-05 | fixed typos | | 3.45.7 | 2018-10-05 | fixed typos |
| 3.45.6 | 2018-09-12 | `mem()` bug parsing linux in other languages | | 3.45.6 | 2018-09-12 | `mem()` bug parsing linux in other languages |
| 3.45.5 | 2018-09-07 | `diskLayout()` tiny bug S.M.A.R.T status windows | | 3.45.5 | 2018-09-07 | `diskLayout()` tiny bug S.M.A.R.T status windows |

View File

@ -56,7 +56,7 @@ function system(callback) {
if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) result.serial = '-'; if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) result.serial = '-';
if (result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) result.manufacturer = ''; if (result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) result.manufacturer = '';
if (result.model.toLowerCase().indexOf('o.e.m.') !== -1) result.model = 'Computer'; if (result.model.toLowerCase().indexOf('o.e.m.') !== -1) result.model = 'Computer';
if (result.version.toLowerCase().indexOf('o.e.m.') !== -1) result.version = '-'; if (result.version.toLowerCase().indexOf('o.e.m.') !== -1) result.version = '';
if (result.sku.toLowerCase().indexOf('o.e.m.') !== -1) result.sku = '-'; if (result.sku.toLowerCase().indexOf('o.e.m.') !== -1) result.sku = '-';
} }
// detect docker // detect docker
@ -71,7 +71,7 @@ function system(callback) {
if (lines.length > 0) result.model = 'Virtual machine'; if (lines.length > 0) result.model = 'Virtual machine';
} }
if (result.manufacturer === '' && result.model === 'Computer' && result.version === '-') { if (result.manufacturer === '' && result.model === 'Computer' && result.version === '') {
// Check Raspberry Pi // Check Raspberry Pi
exec('cat /proc/cpuinfo', function (error, stdout) { exec('cat /proc/cpuinfo', function (error, stdout) {
if (!error) { if (!error) {