pkill instead of subprocess execution for grep and awk (could use pgrep) and kill cmd

You can also use pgrep to grep for running processes and kill them