--- /dev/null
+#!/bin/sh
+# #######################################################################
+# File : /etc/init.d/smc.agent #
+# Description : start-stop-script for secure starting and stopping #
+# the Sun Management Center Agent #
+# Known Bugs : does not remove $LOGFILE, this must be done manually #
+# Author : Frank Brehm <brehm@strato.de> #
+# Created : 2005-04-25 #
+# #######################################################################
+
+# $Id: sicher.sh 315 2005-09-19 11:49:56Z fbrehm $
+# $URL: http://maria.technik.berlin.strato.de:8080/svn/scripts/trunk/solaris/sicher.sh $
+
+sunmc_basedir=""
+/usr/bin/pkginfo -qi SUNWescom
+if [ $? -eq 0 ] ; then
+ sunmc_basedir=`/usr/bin/pkgparam SUNWescom BASEDIR`
+else
+ exit 0
+fi
+
+# exit status
+ESTS=98
+
+# empty log file
+LOGFILE=/tmp/smc-agent.start.`/bin/date +%Y%m%d%H%M%S`
+
+case "$1" in
+
+ 'start')
+
+ if [ -x $sunmc_basedir/SUNWsymon/sbin/es-start ] ; then
+
+ echo "Starting Sun Management Center Agent Layer"
+
+ cp /dev/null ${LOGFILE}
+ # read from logfile to stdout
+ tail -f ${LOGFILE} &
+ LPID=$!
+
+ # Darstellung eines '.' alle 3 Sekunden
+ (while true; do printf "."; sleep 3; done) &
+ DOTPID=$!
+
+ $sunmc_basedir/SUNWsymon/sbin/es-start -aY </dev/null >>$LOGFILE 2>&1
+ ESTS=$?
+
+ CONF_FILE=/etc/opt/SUNWsymon/symon.conf
+ if [ -f "$CONF_FILE" ] ; then
+ /usr/bin/grep platform "$CONF_FILE" > /dev/null
+ if [ $? -eq 0 ] ; then
+ $sunmc_basedir/SUNWsymon/sbin/es-start -l
+ fi
+ fi
+
+ else
+
+ echo "No $sunmc_basedir/SUNWsymon/sbin/es-start found." </dev/null >>$LOGFILE 2>&1
+ ESTS=99
+
+ fi
+
+ # give child processes some time to close file descriptors
+ sleep 2
+
+ # finish logfile output
+ exec 3>&2 2>/dev/null
+ kill $DOTPID $LPID
+ sleep 1
+ exec 2>&3
+
+ # make logfile empty
+ cp /dev/null ${LOGFILE}
+
+ echo
+
+ ;;
+
+ 'stop')
+
+ if [ -f $sunmc_basedir/SUNWsymon/sbin/es-stop ] ; then
+ echo "Stopping Sun Management Center Agent Layer"
+ $sunmc_basedir/SUNWsymon/sbin/es-stop -alY
+ ESTS=$?
+ else
+ echo "No $sunmc_basedir/SUNWsymon/sbin/es-stop found." >&2
+ ESTS=99
+ fi
+
+ ;;
+
+ *)
+
+ echo "Usage: $0 [start|stop]" >&2
+ ESTS=100
+ ;;
+
+esac
+
+exit ${ESTS}
+