Linux Automation Tip: Kill Script if Already Running

Here is a shell script that will allow you to kill a script if it is already running #!/usr/bin/env bash ps -ef | grep $1 | awk ‘{print $2}’ | xargs kill -9 Supply the name of the script as the first parameter and it will look to see if there is a matching process, … Continue reading Linux Automation Tip: Kill Script if Already Running