gluon-status-page: remove workaround for now fixed LuCi bug
This commit is contained in:
parent
14553d42be
commit
104c92dfe6
@ -76,26 +76,13 @@ for _, ifname in ipairs(interfaces) do
|
|||||||
io.write("</pre>")
|
io.write("</pre>")
|
||||||
end
|
end
|
||||||
|
|
||||||
local err, fastd_status = pcall(
|
local stat, fastd_status = pcall(
|
||||||
function()
|
function()
|
||||||
local fastd_sock = nixio.socket('unix', 'stream')
|
local fastd_sock = nixio.socket('unix', 'stream')
|
||||||
assert(fastd_sock:connect('/var/run/fastd.mesh_vpn.socket'))
|
assert(fastd_sock:connect('/var/run/fastd.mesh_vpn.socket'))
|
||||||
|
|
||||||
-- Stop as soon as we see an empty chunk
|
|
||||||
local function guard_source(src)
|
|
||||||
return function()
|
|
||||||
local chunk, err = src()
|
|
||||||
if not chunk then return nil, err end
|
|
||||||
if chunk:len() == 0 then return nil end
|
|
||||||
return chunk
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
source = guard_source(ltn12.source.file(fastd_sock))
|
|
||||||
decoder = json.Decoder()
|
decoder = json.Decoder()
|
||||||
ltn12.pump.all(source, decoder:sink())
|
ltn12.pump.all(ltn12.source.file(fastd_sock), decoder:sink())
|
||||||
fastd_sock:close()
|
|
||||||
|
|
||||||
return decoder:get()
|
return decoder:get()
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
@ -103,7 +90,7 @@ local err, fastd_status = pcall(
|
|||||||
io.write("<h2>VPN status</h2>")
|
io.write("<h2>VPN status</h2>")
|
||||||
io.write("<pre>")
|
io.write("<pre>")
|
||||||
|
|
||||||
if fastd_status then
|
if stat then
|
||||||
io.write(string.format("fastd running for %.3f seconds\n", fastd_status.uptime/1000))
|
io.write(string.format("fastd running for %.3f seconds\n", fastd_status.uptime/1000))
|
||||||
|
|
||||||
local peers = 0
|
local peers = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user