Files
crypto_monitor/manual_trading_hub/scripts/fix_env_crlf.sh
T
dekun 9f67de3677 refactor: 移除 gate_bot,统一为三所架构并更新文档
删除 crypto_monitor_gate_bot 目录,中控与子代理改为 binance/okx/gate 三账户;
文档与 UI 文案「四所」改为「三所」;新增清库前一次性配置备份脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 22:00:08 +08:00

34 lines
910 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
# 去掉各目录 .env 的 Windows 换行符(解决 PM2 agent errored: $'\r': command not found
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO="$(cd "${SCRIPT_DIR}/../.." && pwd)"
dirs=(
"${REPO}/manual_trading_hub"
"${REPO}/crypto_monitor_binance"
"${REPO}/crypto_monitor_okx"
"${REPO}/crypto_monitor_gate"
)
fixed=0
for d in "${dirs[@]}"; do
f="${d}/.env"
if [[ ! -f "${f}" ]]; then
echo "跳过(无文件): ${f}"
continue
fi
if grep -q $'\r' "${f}" 2>/dev/null; then
sed -i 's/\r$//' "${f}"
echo "已修复 CRLF: ${f}"
fixed=$((fixed + 1))
else
echo "已是 LF: ${f}"
fi
done
echo "完成,共修复 ${fixed} 个 .env。"
echo "请重启子代理: cd ${REPO}/manual_trading_hub && pm2 restart manual-agent-gate manual-agent-binance manual-agent-okx"
echo "或: bash scripts/pm2_hub.sh restart"