TLG_JoinCaptchaBot/tools/start

27 wiersze
585 B
Plaintext
Czysty Zwykły widok Historia

#!/usr/bin/env bash
# Actual script directory path
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
# Process ID
PID=$(ps -aux | grep -e "[j]oin_captcha_bot.py" | awk 'FNR == 1 {print $2}')
# Check if process is running
if [ ! -z "$PID" ]; then
echo "Already running."
exit 1
fi
# Clean old/previous residual captcha images
rm -rf $DIR/../src/data/captchas/*
# Launch the Bot
echo "Starting Script..."
2024-08-19 12:23:37 +00:00
source $DIR/../.venv/bin/activate
nohup python3 -u $DIR/../src/join_captcha_bot.py >> $DIR/../output.log 2>&1 &
2024-08-19 12:23:37 +00:00
deactivate
sleep 1
$DIR/status
exit 0