# empty log file
LOGFILE=/tmp/smc-agent.start.`/bin/date +%Y%m%d%H%M%S`
+# run file
+RUNFILE=/var/run/smc.agent.run
+
case "$1" in
'start')
echo
+ if [ $ESTS -eq 0 ] ; then
+ touch $RUNFILE
+ fi
+
;;
'stop')
ESTS=99
fi
+ if [ -f $RUNFILE ] ; then
+ rm -f $RUNFILE
+ fi
+
+ ;;
+
+ 'restart')
+
+ if $0 status >/dev/null ; then
+ $0 stop && $0 start
+ ESTS=$?
+ else
+ $0 start
+ ESTS=$?
+ fi
+
+ ;;
+
+ 'status')
+
+ /usr/bin/ps -ef | grep "esd - init agent" >/dev/null
+ if [ $? -eq 0 ] ; then
+ echo "Sun Management Center Agent Layer is running"
+ ESTS=0
+ else
+ echo "Sun Management Center Agent Layer is stopped"
+ ESTS=1
+ fi
+
;;
*)
- echo "Usage: $0 [start|stop]" >&2
+ echo "Usage: $0 [start|stop|restart|status]" >&2
ESTS=100
;;