#!/bin/bash # 换网段后确认状态 set -u echo "════════ 1. 本机网络 ════════" ip -br addr 2>/dev/null | sed 's/^/ /' echo " 到网关: $(ip route 2>/dev/null | grep default | head -1)" echo echo "════════ 2. 中转/隧道/看门狗 ════════" echo " relay: $(systemctl is-active lanremote-relay)" echo " tunnel: $(systemctl is-active lanremote-tunnel)" echo " tunnel-h2:$(systemctl is-active lanremote-tunnel-h2)" echo " watchdog: $(systemctl is-active lanremote-watchdog.timer)" echo echo "════════ 3. 当前配比 ════════" for svc in lanremote-tunnel lanremote-tunnel-h2; do echo " $svc: $(systemctl cat $svc 2>/dev/null | grep -oE '\-\-metrics [0-9.:]+|\-\-protocol [a-z0-9]+|\-\-ha-connections [0-9]+' | tr '\n' ' ')" done echo " MTU: $(cat /sys/class/net/wlan0/mtu 2>/dev/null)" echo " 连接: quic=$(curl -s --max-time 5 http://127.0.0.1:20241/metrics 2>/dev/null | grep ha_connections | awk '{print $2}') http2=$(curl -s --max-time 5 http://127.0.0.1:20242/metrics 2>/dev/null | grep ha_connections | awk '{print $2}')" echo echo "════════ 4. 公网通不通 ════════" for i in 1 2 3; do c=$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 -H 'User-Agent: LanRemote/1.8.2' https://relay.xxmxxs.top/v1/health) echo " 第 $i 次: $c" sleep 1 done echo echo "════════ 5. 之前的长测数据还在不在 ════════" for f in /root/long2h_health.tsv /root/long2h_conns.tsv /root/rp_poll30.tsv; do if [ -f "$f" ]; then echo " $f: $(wc -l < "$f") 行 最后修改 $(stat -c %y "$f" | cut -d. -f1)" else echo " $f: 不存在" fi done echo echo "════════ 6. 还在跑的测试进程 ════════" pgrep -af 'rp_long2h|rpp30|rp_ab_long' | sed 's/^/ /' || echo " (没有)" echo echo "════════ 7. 设备内存/负载 ════════" free -m | sed 's/^/ /' uptime | sed 's/^/ /'