|
|
@@ -23,12 +23,11 @@ get_srv_state() {
|
|
|
proc_name=${2-$1}
|
|
|
|
|
|
# Check service status
|
|
|
- status=1
|
|
|
- if [ ! -z "$(service $srv status| grep running)" ]; then
|
|
|
- status=0
|
|
|
- fi
|
|
|
+ status=$(service $srv status 2>/dev/null)
|
|
|
+ rc=$?
|
|
|
+ stopped=$(echo $status| grep stop)
|
|
|
|
|
|
- if [ $status -eq 0 ]; then
|
|
|
+ if [ "$rc" -eq 0 ] && [ -z "$stopped" ]; then
|
|
|
state='running'
|
|
|
|
|
|
# Calculate cpu and memory usage
|