stop-monitor.sh 306 B

12345678910111213141516
  1. #!/bin/sh
  2. echo "Shutting down Monitor"
  3. pid_list="$(ps aux | grep ipfcst-monitor | grep -v grep | awk '{print $2}')"
  4. if test -z $pid_list; then
  5. echo "Monitor is not running"
  6. else
  7. for pid in $pid_list; do
  8. if kill -0 "$pid" 2>/dev/null; then
  9. echo "kill pid $pid"
  10. kill -9 $pid
  11. fi
  12. done
  13. fi
  14. exit 0