status-upload.sh 364 B

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