#!/bin/bash # 验收:产品展示区块 + 截图路由 + 原有功能没被搞坏 set -u BASE=http://127.0.0.1:8080 PUB=https://relay.xxmxxs.top KEY=$(cat /root/lanremote-relay/data/admin_key.txt 2>/dev/null) curl -s --max-time 15 "$BASE/" -o /tmp/s.html size=$(wc -c < /tmp/s.html) code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 "$BASE/") echo " 官网 HTTP $code $size 字节" echo echo " 新增区块:" has() { if grep -q "$1" /tmp/s.html; then echo " ✓ $2"; else echo " ✗ $2"; fi; } has 'id="shots"' '产品展示(长什么样)' has 'class="watch"' '手表界面 mockup' has 'w-tab' '手表标签条' has '/shot/pc-main.png' '电脑端真实截图' has 'id="how-connect"' '怎么连上的' has 'class="flow"' '连接方式示意' has '局域网 3 ms' '局域网延迟标注' echo echo " 区块计数:" printf " 手表标签 %s 个(应为 10)\n" "$(grep -o 'w-tab' /tmp/s.html | wc -l)" printf " 手表按钮 %s 个(应为 9)\n" "$(grep -o 'class="w-btn"' /tmp/s.html | wc -l)" printf " 连接示意 %s 列(应为 2)\n" "$(grep -o 'class="flow-col"' /tmp/s.html | wc -l)" echo echo " 原有区块还在吗:" for pair in "吸顶导航:nav-in" "Hero:hero" "功能网格:id=\"features\"" \ "三步上手:id=\"how\"" "下载区:id=\"download\"" "FAQ:id=\"faq\""; do has "${pair#*:}" "${pair%%:*}" done echo echo " 截图路由:" echo " /shot/pc-main.png HTTP $(curl -s -o /dev/null -w '%{http_code}' --max-time 15 "$BASE/shot/pc-main.png") $(curl -s -o /dev/null -w '%{size_download}' --max-time 15 "$BASE/shot/pc-main.png") 字节" echo " 路径穿越 /shot/../relay.py HTTP $(curl -s -o /dev/null -w '%{http_code}' --max-time 15 "$BASE/shot/../relay.py")" echo " 非图片 /shot/x.txt HTTP $(curl -s -o /dev/null -w '%{http_code}' --max-time 15 "$BASE/shot/x.txt")" echo echo " 其它功能:" echo " /v1/health HTTP $(curl -s -o /dev/null -w '%{http_code}' --max-time 15 "$BASE/v1/health")" echo " /zhongzhuanzhan HTTP $(curl -s -o /dev/null -w '%{http_code}' --max-time 15 "$BASE/zhongzhuanzhan")" echo " /v1/downloads HTTP $(curl -s -o /dev/null -w '%{http_code}' --max-time 15 "$BASE/v1/downloads")" echo " health 大小 $(curl -s --max-time 10 "$BASE/v1/health" | wc -c) 字节" echo echo " 公网:" for i in 1 2 3 4 5; do printf " %d: HTTP %s\n" "$i" "$(curl -s -o /dev/null -w '%{http_code}' --max-time 20 -H 'User-Agent: LanRemote/1.4.0' "$PUB/")" done