Files
crypto_monitor/manual_trading_hub/scripts/verify_hub_deploy.sh
T

26 lines
870 B
Bash
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
# 在服务器上检查中控是否为最新代码(无 api_trade_key、已装 multipart
set -euo pipefail
HUB_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$HUB_DIR"
echo "=== hub.py 检查 ==="
if grep -n 'def api_trade_key' hub.py 2>/dev/null; then
echo "FAIL: 仍是旧版 hub.py(含 api_trade_key),请 git pull 或同步最新代码"
exit 1
fi
if ! grep -q 'HUB_BUILD' hub.py; then
echo "FAIL: hub.py 缺少 HUB_BUILD 标记,代码过旧"
exit 1
fi
echo "OK: 无 api_trade_key,含 HUB_BUILD"
echo "=== python-multipart ==="
# shellcheck source=/dev/null
source .venv/bin/activate
python -c "import multipart; print('OK:', multipart.__version__)"
echo "=== /api/ping ==="
curl -sf http://127.0.0.1:5100/api/ping | python -m json.tool
echo ""
echo "若 build 不是 20260521-no-trade-ui,请 pm2 restart manual-trading-hub"