-for line in io.lines(res_input) do
- local name,
- location,
- dnssec,
- nolog = line:match("^([^,]+),.-,\".-\",\"*(.-)\"*,.-,[0-9],\"*([yesno]+)\"*,\"*([yesno]+)\"*,.*")
- if name ~= "" and name ~= "Name" then
- if location == "" then
- location = "-"
- end
- if dnssec == "" then
- dnssec = "-"
- end
- if nolog == "" then
- nolog = "-"
+if fs.access(res_input) then
+ for line in io.lines(res_input) or {} do
+ local name,
+ location,
+ dnssec,
+ nolog = line:match("^([^,]+),.-,\".-\",\"*(.-)\"*,.-,[0-9],\"*([yesno]+)\"*,\"*([yesno]+)\"*,.*")
+ if name ~= "" and name ~= "Name" then
+ if location == "" then
+ location = "-"
+ end
+ if dnssec == "" then
+ dnssec = "-"
+ end
+ if nolog == "" then
+ nolog = "-"
+ end
+ res_list[#res_list + 1] = { name = name, location = location, dnssec = dnssec, nolog = nolog }