修复bug

This commit is contained in:
dekun
2026-05-24 07:43:05 +08:00
parent a3218f4fbd
commit 4b5fae2946
6 changed files with 26 additions and 11 deletions
+3 -1
View File
@@ -29,4 +29,6 @@ for d in "${dirs[@]}"; do
fi
done
echo "完成,共修复 ${fixed} 个 .env。请执行: pm2 restart ecosystem.config.cjs"
echo "完成,共修复 ${fixed} 个 .env。"
echo "请重启子代理: cd ${REPO}/manual_trading_hub && pm2 restart manual-agent-gate manual-agent-gate-bot manual-agent-binance manual-agent-okx"
echo "或: bash scripts/pm2_hub.sh restart"
+3
View File
@@ -20,6 +20,9 @@ if [[ ! -x "${VENV_PY}" ]]; then
fi
if [[ -f .env ]]; then
if grep -q $'\r' .env 2>/dev/null; then
echo "警告: $(pwd)/.env 含 Windows 换行(CRLF),请在仓库根执行: bash manual_trading_hub/scripts/fix_env_crlf.sh" >&2
fi
if ! load_dotenv_file ".env"; then
echo "错误: $(pwd)/.env 加载失败" >&2
exit 1
@@ -53,11 +53,11 @@ start_one() {
fi
screen -dmS "${name}" bash -c "
cd '${work}' || { echo 'cd failed' >>'${logf}'; exit 1; }
set -a
# shellcheck source=lib_load_dotenv.sh
source '${HUB_DIR}/scripts/lib_load_dotenv.sh'
if [[ -f .env ]]; then
. ./.env
load_dotenv_file .env >>'${logf}' 2>&1 || echo 'load .env failed' >>'${logf}'
fi
set +a
export EXCHANGE='${exchange}' PORT='${port}' HOST=127.0.0.1
exec '${VENV_PY}' '${AGENT_PY}' >>'${logf}' 2>&1
"
@@ -49,11 +49,11 @@ fi
screen -dmS mt-hub bash -c "
set -e
cd '${HUB_DIR}'
set -a
# shellcheck source=lib_load_dotenv.sh
source '${HUB_DIR}/scripts/lib_load_dotenv.sh'
if [[ -f .env ]]; then
. ./.env
load_dotenv_file .env
fi
set +a
export HUB_AGENTS='${HUB_AGENTS}'
${EXTRA_NAMES}
export HUB_HOST='${HUB_HOST}'