status-console.sh 368 B

12345678910111213141516
  1. #!/bin/sh
  2. pid_list="$(ps aux | grep ipfcst-console | grep -v grep | awk '{print $2}')"
  3. pid_count=$(echo $pid_list | wc -w)
  4. if test $pid_count -eq 1; then
  5. echo "console running, pid is $pid_list"
  6. exit 0
  7. elif test $pid_count -gt 1; then
  8. echo "Multiple console running $pid_list"
  9. exit 1
  10. elif test -z $pid_list; then
  11. echo "console is not running"
  12. exit 1
  13. fi
  14. exit 0