Files
ykxmz/_build/check_relay_state.py
T
xmz7891 81e923a0aa 1.7.1:修白屏 + 配对 + 官网管理页分家
手表端
- 修「连上后一片白屏」:initTabs() 从来没被调用过,
  导致 tabDefs 为 null、selectTab 直接 return,
  标签栏里只剩一个孤立的滑动指示器
- 应用名改成 ykxmz

被控端
- 修「设备已关闭新设备配对」:配对码本身就是密钥,
  拿着正确的码就该放行。老逻辑"首台配对后自动关窗"会把
  手表重装的人永久挡在外面
- 应用名改成 ykxmz

服务器端
- / 改成官网(公开,简洁介绍 + 下载)
- /zhingzhuanzhan 中转站管理(要登录),/admin 自动跳转
- 管理账号 xmz7891,可改
- 官网 / 登录页 / 管理页都加上 favicon
2026-10-06 23:08:07 +08:00

41 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
r'''检查 relay 服务状态并重跑网页检查。'''
from __future__ import annotations
import sys
import time
from pathlib import Path
ROOT = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote")
sys.path.insert(0, str(ROOT / "_build"))
from devssh import run # noqa: E402
def main() -> int:
print(" 服务状态:")
_c, out, _e = run(
"for s in lanremote-relay lanremote-tunnel lanremote-nettune.service; do "
"printf ' %-26s %s\\n' $s $(systemctl is-active $s); done", timeout=60)
print(out)
print(" 监听端口:")
_c, out, _e = run("ss -tlnp 2>/dev/null | grep -E '8080|:80 ' | head -5",
timeout=60)
print(out or " (没在监听 8080)")
print(" 最后几行日志:")
_c, out, _e = run("tail -12 /root/lanremote-relay/relay.log 2>/dev/null",
timeout=60)
print(out)
print(" 等一下再跑检查…")
time.sleep(6)
_c, out, _e = run("bash /root/check_web.sh 2>&1", timeout=240)
print(out)
return 0
if __name__ == "__main__":
sys.exit(main())