| 4.22.6 |
2020-03-08 |
diff --git a/docs/index.html b/docs/index.html
index 303449c..00bb927 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -168,7 +168,7 @@
systeminformation
- Current Version: 4.22.6
+ Current Version: 4.22.7
diff --git a/lib/filesystem.js b/lib/filesystem.js
old mode 100644
new mode 100755
index 5ff3e38..f64c513
--- a/lib/filesystem.js
+++ b/lib/filesystem.js
@@ -722,11 +722,13 @@ function diskLayout(callback) {
];
let result = '';
- model = model.toUpperCase();
- diskManufacturers.forEach((manufacturer) => {
- const re = RegExp(manufacturer.pattern);
- if (re.test(model)) { result = manufacturer.manufacturer; }
- });
+ if (model) {
+ model = model.toUpperCase();
+ diskManufacturers.forEach((manufacturer) => {
+ const re = RegExp(manufacturer.pattern);
+ if (re.test(model)) { result = manufacturer.manufacturer; }
+ });
+ }
return result;
}
@@ -745,21 +747,21 @@ function diskLayout(callback) {
try {
const outJSON = JSON.parse(out);
if (outJSON && {}.hasOwnProperty.call(outJSON, 'blockdevices')) {
- devices = outJSON.blockdevices.filter(item => { return item.group === 'disk' && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null)); });
+ devices = outJSON.blockdevices.filter(item => { return (item.group === 'disk' || item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null)); });
}
} catch (e) {
// fallback to older version of lsblk
const out2 = execSync('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL').toString();
let lines = blkStdoutToObject(out2).split('\n');
const data = parseBlk(lines);
- devices = data.filter(item => { return item.group === 'disk' && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mountpoint === '' && item.label === '' && item.fstype === '')); });
+ devices = data.filter(item => { return (item.group === 'disk' || item.type === 'disk') && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mountpoint === '' && item.label === '' && item.fstype === '')); });
}
devices.forEach((device) => {
let mediumType = '';
const BSDName = '/dev/' + device.name;
const logical = device.name;
try {
- mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational').toString().split('\n')[0];
+ mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null').toString().split('\n')[0];
} catch (e) {
util.noop();
}
@@ -793,8 +795,6 @@ function diskLayout(callback) {
util.noop();
}
}
- // lshw sometimes returns empty results, try lsblk
-
// check S.M.A.R.T. status
if (cmd) {
cmd = cmd + 'printf "\n"';