Files

27 lines
857 B
Bash
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
# 仅重启失败的子代理(保留 hub / 已 online 的 agent
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
HUB_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
ECO="${HUB_DIR}/ecosystem.config.cjs"
cd "${HUB_DIR}"
chmod +x scripts/run_agent.sh scripts/run_hub.sh 2>/dev/null || true
AGENTS=(manual-agent-binance manual-agent-okx manual-agent-gate manual-agent-gate-bot)
for n in "${AGENTS[@]}"; do
pm2 delete "${n}" 2>/dev/null || true
done
pm2 start "${ECO}" --only manual-agent-binance
pm2 start "${ECO}" --only manual-agent-gate
pm2 start "${ECO}" --only manual-agent-gate-bot
# OKX 若已 online 可跳过;若也挂了则:
# pm2 start "${ECO}" --only manual-agent-okx
pm2 save 2>/dev/null || true
echo "已重建 binance / gate / gate-bot 子代理,请执行: bash scripts/check_agents.sh"