#!/bin/bash # Find the process ID (PID) of the running main.py script PID=$(pgrep -f "python .*main.py") # Check if the process is running if [ -z "$PID" ]; then echo "Process main.py not found." else # Kill the process kill -9 $PID echo "Process main.py with PID $PID has been killed." fi