diff options
-rw-r--r-- | health-model.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/health-model.lua b/health-model.lua index 16b4d2a..2749e2a 100644 --- a/health-model.lua +++ b/health-model.lua @@ -58,7 +58,15 @@ get_storage = function (self) local storage = {} local disk = diskfree() .. "\n" local other = {} - for line in string.gmatch(disk, "\n([^\n]*\n[^\n]*)") do + local lines = format.string_to_table(disk, "\n") + local i = 1 -- skip the first line + while i < #lines do + i = i+1 + line = lines[i] or "" + if lines[i+1] and string.match(lines[i+1], "^%s") then + i = i+1 + line = line .. "\n" .. lines[i] + end if string.match(line, "^/dev/fd%d+") then if not storage.floppy then storage.floppy = cfe({ type="group", value={}, label="Floppy drives" }) |