luci-mod-status: switch iptables_dump action to luci.sys.process.exec
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
1b26c91a08
commit
df9ba6981e
1 changed files with 6 additions and 16 deletions
|
@ -52,22 +52,12 @@ function dump_iptables(family, table)
|
||||||
local s
|
local s
|
||||||
for s in lines do
|
for s in lines do
|
||||||
if s == table then
|
if s == table then
|
||||||
local ipt = io.popen(
|
luci.http.prepare_content("text/plain")
|
||||||
"/usr/sbin/%stables -w -t %s --line-numbers -nxvL"
|
luci.sys.process.exec({
|
||||||
%{ prefix, table })
|
"/usr/sbin/%stables" % prefix, "-w", "-t", table,
|
||||||
|
"--line-numbers", "-nxvL"
|
||||||
if ipt then
|
}, luci.http.write)
|
||||||
luci.http.prepare_content("text/plain")
|
return
|
||||||
|
|
||||||
while true do
|
|
||||||
s = ipt:read(1024)
|
|
||||||
if not s then break end
|
|
||||||
luci.http.write(s)
|
|
||||||
end
|
|
||||||
|
|
||||||
ipt:close()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue