MCPcopy Create free account
hub / github.com/StarsTom/mobileCodexHelper / load_tailscale_status

Function load_tailscale_status

mobile_codex_control.py:456–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

454
455
456def load_tailscale_status() -> dict[str, Any]:
457 if not TAILSCALE.exists():
458 return {"ok": False, "error": f"Tailscale CLI 未找到:{TAILSCALE}"}
459 result = run_command([str(TAILSCALE), "status", "--json"])
460 if result.returncode != 0:
461 return {"ok": False, "error": result.stderr.strip() or result.stdout.strip() or "读取 Tailscale 状态失败"}
462 try:
463 return {"ok": True, "data": json.loads(result.stdout)}
464 except json.JSONDecodeError as exc:
465 return {"ok": False, "error": f"Tailscale 返回的 JSON 无法解析: {exc}"}
466
467
468def load_serve_status() -> dict[str, Any]:

Callers 2

collect_statusFunction · 0.85

Calls 1

run_commandFunction · 0.85

Tested by

no test coverage detected