blockDevices() improvements

This commit is contained in:
Sebastian Hildebrandt 2021-02-12 14:56:32 +01:00
parent ebf646c645
commit ed9bf356ce

View File

@ -806,7 +806,7 @@ function diskLayout(callback) {
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.type === 'disk') && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mountpoint === '' && item.label === '' && item.fsType === '')); });
devices = data.filter(item => { return (item.type === 'disk') && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mount === '' && item.label === '' && item.fsType === '')); });
}
devices.forEach((device) => {
let mediumType = '';