12345678910111213141516 |
- #!/bin/sh
- pid_list="$(ps aux | grep ipfcst-monitor | grep -v grep | awk '{print $2}')"
- pid_count=`echo $pid_list | wc -w`
- if test $pid_count -eq 1 ; then
- echo "Monitor running, pid is $pid_list"
- exit 0
- elif test $pid_count -gt 1 ; then
- echo "Multiple Monitor running $pid_list"
- exit 1
- elif test -z $pid_list ; then
- echo "Monitor is not running"
- exit 1
- fi
- exit 0
|