Commit 443aaefd authored by Ted Trask's avatar Ted Trask

Removed unwanted lines from 'ip xfrm state' output

parent 0d2e99cc
......@@ -37,12 +37,12 @@ local function phase2details(dst)
local output = {}
dst = string.match(dst,"^(.*)%.") -- Removes the portnumber
local value = modelfunctions.run_executable({"ip", "xfrm", "state", "list", "src", dst})
-- REMOVE THE LINES THAT DON'T START WITH "src" io.popen
table.insert(output, {label="Outgoing", value=value})
-- Get rid of all lines that don't start with "src"
table.insert(output, {label="Outgoing", value=string.gsub(value, "\n[^s][^\n]*", "")})
value = modelfunctions.run_executable({"ip", "xfrm", "state", "list", "dst", dst})
-- REMOVE THE LINES THAT DON'T START WITH "src" io.popen
table.insert(output, {label="Incoming", value=value})
-- Get rid of all lines that don't start with "src"
table.insert(output, {label="Incoming", value=string.gsub(value, "\n[^s][^\n]*", "")})
return output
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment