stop-monitor.sh 310 B

1234567891011121314151617
  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;
  8. do
  9. if kill -0 "$pid" 2>/dev/null; then
  10. echo "kill pid $pid"
  11. kill -9 $pid
  12. fi
  13. done
  14. fi
  15. exit 0