TLG_JoinCaptchaBot/sources/forcekill

22 wiersze
409 B
Bash
Executable File

#!/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}'`
if [ -z "$PID" ]; then
echo "Script is not running."
exit 1
fi
kill -9 $PID
echo "Killing script, please wait..."
while $(kill -0 $PID 2>/dev/null); do
sleep 1
done
$DIR/status
exit 0