mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-17 22:13:17 +08:00
🔥 Sync 2026-11-16 16:50:07
This commit is contained in:
1 parent
6b8b3fec62
commit
a2bf4e439b
87 files changed
+2498
-180
No files matched your search
@@ -193,8 +193,28 @@ function getNetdevStats()
|
||||
end
|
||||
end
|
||||
|
||||
-- ── RJ11 phone port (fxsd on the AW1000), left out when not installed ─────
|
||||
local phone = nil
|
||||
if nfs.access("/usr/sbin/fxsd") then
|
||||
local st = {}
|
||||
local sf = io.open("/var/run/fxsd.state", "r")
|
||||
if sf then
|
||||
for line in sf:lines() do
|
||||
local k, v = line:match("^(%w+)=(.*)$")
|
||||
if k then st[k] = v end
|
||||
end
|
||||
sf:close()
|
||||
end
|
||||
uci:unload("fxs")
|
||||
local on = os.execute("pidof fxsd >/dev/null 2>&1") == 0
|
||||
and uci:get("fxs", "main", "enabled") ~= "0"
|
||||
and (st.state or "stopped") ~= "stopped"
|
||||
phone = { on = on, state = st.state or "stopped", offhook = st.offhook == "1" }
|
||||
end
|
||||
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ stats = stats, ip = ip, ip_source = ip_source,
|
||||
phone = phone,
|
||||
status = status,
|
||||
prefer_iface = prefer_iface,
|
||||
vnstat_total = vnstat_total,
|
||||
|
||||
Reference in new issue
Block a user