KillProcesses.sh 210 B

123456789101112
  1. #!/usr/bin/env bash
  2. # list processes that would be killed so they appear in the log
  3. p=$(pgrep dotnet)
  4. if [ $? -eq 0 ]
  5. then
  6. echo "These processes will be killed..."
  7. ps -p $p
  8. fi
  9. pkill dotnet || true
  10. exit 0