TLG_JoinCaptchaBot/tools/forcekill

26 wiersze
493 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}')
# Check if process is running
if [ -z "$PID" ]; then
echo "Script is not running."
exit 1
fi
# Kill the process
kill -9 $PID
echo "Killing script, please wait..."
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