#!/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 "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 $DIR/status exit 0