#!/bin/bash

status=`/etc/init.d/DmServiceDMSERVER status | grep running | wc -l`

process=`ps -ef | grep dmserver | grep -v grep | wc -l`

port=`lsof -i:5236 | grep -i listen | wc -l`

if
    [ $port -ne 0 ] && [ $process -ne 0 ] && [ $status -ne 0 ]

    then

        echo "dmserver is running"

    else

        echo "dmserver is not running"

fi