TLG_JoinCaptchaBot/tools/stop

26 wiersze
490 B
Plaintext

#!/usr/bin/env bash
2021-03-31 18:01:10 +00:00
# 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}')
2019-04-12 15:22:10 +00:00
# Check if process is running
if [ -z "$PID" ]; then
2019-04-12 15:22:10 +00:00
echo "Script is not running."
exit 1
fi
# Kill the process
echo "Killing script, please wait..."
2020-07-11 14:40:42 +00:00
kill $PID
while $(kill -0 $PID 2>/dev/null); do
sleep 1
done
# Show process status after kill
2021-03-31 18:01:10 +00:00
$DIR/status
exit 0