24 lines
552 B
Bash
Executable File
24 lines
552 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Check if any arguments were provided
|
|
if [ $# -eq 0 ]; then
|
|
echo "Usage: $0 <config.yaml> [additional configs...]"
|
|
exit 1
|
|
fi
|
|
|
|
while true; do
|
|
# Remove any existing restart flags before starting
|
|
rm -f .restart_flag_*
|
|
|
|
python main.py "$@"
|
|
|
|
# Check for any restart flags
|
|
if ls .restart_flag_* 1> /dev/null 2>&1; then
|
|
echo "Restart flag(s) found, restarting bot(s)..."
|
|
sleep 1
|
|
continue
|
|
else
|
|
echo "Bot(s) exited without restart flag, stopping..."
|
|
break
|
|
fi
|
|
done |