Files
vtuber/scripts/verify-live-domain-110.sh

34 lines
883 B
Bash
Executable File
Raw Permalink 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
set -euo pipefail
DOMAIN="${1:-vtuber.wooo.work}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
cd "${ROOT_DIR}"
echo "=== Step 1: 執行正式站推版+外網可用性基礎檢查 ==="
./scripts/deploy-and-verify-vtuber110.sh
echo
echo "=== Step 2: 正式網域直播頁路由逐一驗證 ==="
for path in "/live/demo" "/zh-TW/live/demo"; do
url="https://${DOMAIN}${path}"
http_code="$(curl -ksS -m 12 -o /dev/null -w '%{http_code}' "$url" || true)"
if [ -z "${http_code}" ] || [ "${http_code}" = "000" ]; then
echo "${url}:連線失敗"
exit 1
elif [ "${http_code}" != "200" ]; then
echo "${url}HTTP ${http_code}(預期 200"
exit 1
else
echo "${url}HTTP ${http_code}"
fi
done
echo
echo "✅ 所有正式網域直播路由驗證通過。"