Files
workphone-sdk/sdk/scripts/verify_production_urls.sh

27 lines
759 B
Bash
Executable File
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.

#!/usr/bin/env bash
# 验收家里 NAS + kr HTTPS 生产入口2026-05-24
set -euo pipefail
RESOLVE=(--resolve workphone.quwanzhi.com:443:43.139.27.93)
BASE="https://workphone.quwanzhi.com"
check() {
local path="$1" expect="$2"
local code body
code=$(curl -sk -m 15 "${RESOLVE[@]}" -o /tmp/wp_verify_body -w '%{http_code}' "${BASE}${path}")
body=$(head -c 200 /tmp/wp_verify_body)
if [[ "$code" == "$expect" ]] || [[ "$body" == *"$expect"* ]]; then
echo "OK ${path}${code} ${body:0:80}"
else
echo "FAIL ${path}${code} ${body:0:120}"
exit 1
fi
}
echo ">>> 工作手机生产 URL 验收 ${BASE}"
check /health healthy
check /hub 200
check /docs 200
check /api/v3/gateway/info 工作手机SDK
echo ">>> 全部通过"