mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-08-03 16:19:32 +08:00
18 lines
492 B
Lua
Executable File
18 lines
492 B
Lua
Executable File
module("luci.controller.onliner",package.seeall)
|
|
nixio=require"nixio"
|
|
|
|
function index()
|
|
entry({"admin", "status", "onliner"}, template("onliner/onliner"), _("在线用户"))
|
|
entry({"admin", "status", "onliner", "setnlbw"}, call("set_nlbw"))
|
|
end
|
|
|
|
function set_nlbw()
|
|
if nixio.fs.access("/var/run/onsetnlbw") then
|
|
nixio.fs.writefile("/var/run/onsetnlbw","1");
|
|
else
|
|
io.popen("/usr/share/onliner/setnlbw.sh &")
|
|
end
|
|
luci.http.prepare_content("application/json")
|
|
luci.http.write('')
|
|
end
|