Files
telegram-customer-bot/run_bot_loop.sh
2025-11-01 21:58:31 +08:00

16 lines
477 B
Bash
Executable File
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.

#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")" || exit 1
LOG_FILE="bot_agent_sdk.log"
mkdir -p logs
LOG_PATH="$(pwd)/$LOG_FILE"
while true; do
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ▶️ 启动客服机器人" | tee -a "$LOG_PATH"
python3 -u integrated_bot_ai.py 2>&1 | tee -a "$LOG_PATH"
exit_code=${PIPESTATUS[0]}
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ⚠️ 机器人退出,状态码 $exit_code5 秒后重启" | tee -a "$LOG_PATH"
sleep 5
done