From: Frank Brehm Date: Mon, 14 Nov 2005 12:01:56 +0000 (+0000) Subject: Kommandos restart + status dazu, runfile angelegt X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=2323cf0445e94796d6dd175bed175b8379adcaee;p=scripts%2Fsolaris.git Kommandos restart + status dazu, runfile angelegt --- diff --git a/smc.agent b/smc.agent index c234425..2d6e86f 100755 --- a/smc.agent +++ b/smc.agent @@ -25,6 +25,9 @@ ESTS=98 # 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') @@ -74,6 +77,10 @@ case "$1" in echo + if [ $ESTS -eq 0 ] ; then + touch $RUNFILE + fi + ;; 'stop') @@ -87,11 +94,40 @@ case "$1" in 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 ;;