-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbot-start.sh
More file actions
executable file
·29 lines (25 loc) · 876 Bytes
/
bot-start.sh
File metadata and controls
executable file
·29 lines (25 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# NOTE: This file has been moved to bot/up.sh for better organization
# This file is kept for backward compatibility
# Please use: ./bot/up.sh or bun bot/up.sh instead
cd "$(dirname "$0")"
echo "⚠️ Note: bot-start.sh has been moved to bot/up.sh"
echo " Please use './bot/up.sh' for future runs"
echo ""
# Auto-restart loop for the bot
# The bot will exit with code 0 when it detects file changes and is idle
# This script will automatically restart it
while true; do
# PRBOT_PORT=3475
# bunx kill-port 3475
echo "[$(date)] Starting ComfyPR Bot..."
/root/.bun/bin/bun bot/index.ts --continue
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "[$(date)] Bot exited cleanly (code 0) - restarting in 2 seconds..."
sleep 2
else
echo "[$(date)] Bot crashed with exit code $EXIT_CODE - restarting in 5 seconds..."
sleep 5
fi
done