Files
cosec_automation/kill.sh
T
2025-11-14 16:52:50 +05:30

16 lines
354 B
Bash

#!/bin/bash
# Kill all the scripts:
echo "Killing the script."
pkill -9 -f "$(pwd)/main.py"
# Get the name of the current directory,
# and kill the monitors of the above scripts:
echo "Killing the monitors."
PARENT_WD=$(pwd)
CURRENT_DIR_NAME=$(basename "$PARENT_WD")
pgrep -f "$CURRENT_DIR_NAME.*python" | xargs kill -9
# All done:
echo "Done!"
exit 0