#!/bin/bash DATE=`date +%Y%m%d=%r=` DIR="$PATH" DAMON_NUM1=`ps -ef | grep $DAEMON | egrep -v grep | wc -l` if [ "$DAMON_NUM1" = "0" ] ; then cd $DIR echo "$DATE check [ Fail ]" >> /var/log/dmcheck.log ./$DAEMON & fi echo "$DATE check [ O K ]" >> /var/log/dmcheck.log