mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 18:05:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,32 @@
|
||||
module("luci.controller.syncdial", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/syncdial") then
|
||||
return
|
||||
end
|
||||
|
||||
local page
|
||||
page = entry({"admin", "network", "syncdial"}, cbi("syncdial"), _("多线多拨"),103)
|
||||
page.dependent = true
|
||||
page.acl_depends = { "luci-app-syncdial" }
|
||||
|
||||
page = entry({"admin", "network", "syncdial", "status"}, call("act_status"))
|
||||
page.leaf = true
|
||||
page = entry({"admin", "network", "macvlan_redial"}, call("redial"), nil)
|
||||
page.leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e = {}
|
||||
local mwan3_status = luci.util.exec("mwan3 status")
|
||||
e.num_online = 0
|
||||
for _ in mwan3_status:gmatch("tracking is active") do
|
||||
e.num_online = e.num_online + 1
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
||||
function redial()
|
||||
os.execute("killall -9 pppd")
|
||||
end
|
||||
Reference in new issue
Block a user