Fix OpenWrt hostapd client fetch
This commit is contained in:
@@ -282,14 +282,11 @@ async def get_openwrt_status(cfg: dict[str, Any]) -> str:
|
||||
ifnames = sorted({name for name in ifnames if name})
|
||||
if ifnames:
|
||||
for ifname in ifnames:
|
||||
cmd_clients = ssh_cmd + [
|
||||
"sh",
|
||||
"-c",
|
||||
f"ubus call hostapd.{ifname} get_clients 2>/dev/null || echo '{{}}'",
|
||||
]
|
||||
cmd_clients = ssh_cmd + ["ubus", "call", f"hostapd.{ifname}", "get_clients"]
|
||||
rc2, out2 = await run_cmd_full(cmd_clients, timeout=timeout_sec + 15)
|
||||
if rc2 == 124:
|
||||
return f"⚠️ OpenWrt SSH error (wifi clients {ifname}): timeout"
|
||||
return f"?? OpenWrt SSH error (wifi clients {ifname}): timeout"
|
||||
if rc2 == 0:
|
||||
payload = _safe_json_load(out2)
|
||||
if payload:
|
||||
wifi_clients.extend(_parse_hostapd_clients(payload, ifname))
|
||||
|
||||
Reference in New Issue
Block a user