#!/bin/bash process_name="/root/dotnet/dotnet /root/watchdog/eStation.Watchdog.dll" pid=$(ps -ef | grep "$process_name" | grep -v grep | awk '{print $2}') if [[ -n $pid ]]; then echo "Killing process $pid" kill -9 $pid else echo "Process $process_name not found" fi