#!/sbin/sh
#
# Copyright (c) 2002-2012, Perfcap Corporation,Nashua NH
# All Rights Reserved
#
# Startup script for ecap_monitor, pawzagent and pawz realtime agent
# on HP-UX
#
# Setup:
#
# cp /opt/perfcap/settings/perfcap.initd  /sbin/init.d/perfcap
# chown bin:bin /sbin/init.d/perfcap
# chmod 555 /sbin/init.d/perfcap
# ln -s /sbin/init.d/perfcap   /sbin/rc3.d/S99perfcap
# ln -s /sbin/init.d/perfcap  /sbin/rc0.d/K99perfcap
#---------------------------------------------------------------------

PERFCAP_LIBRARY=/opt/perfcap

case "$1" in
start_msg)
	echo "Starting PerfCap"
	;;

stop_msg)
	echo "Stopping PerfCap"
	;;
'start')
	if [ -x $PERFCAP_LIBRARY/bin/ecap_monitor ]; then
	   $PERFCAP_LIBRARY/bin/ecap_monitor
	fi
	if [ -x $PERFCAP_LIBRARY/bin/pawzagent ]; then
	   $PERFCAP_LIBRARY/bin/pawzagent
	fi
	if [ -x $PERFCAP_LIBRARY/bin/pawzrta ]; then
	   $PERFCAP_LIBRARY/bin/pawzrta
	fi
	;;
'stop')
	if [ -x $PERFCAP_LIBRARY/bin/ecap_monitor ]; then
	    $PERFCAP_LIBRARY/bin/ecap_monitor -stop
	fi
	if [ -x $PERFCAP_LIBRARY/bin/pawzagent ]; then
	     $PERFCAP_LIBRARY/bin/pawzagent -stop
	fi
	if [ -x $PERFCAP_LIBRARY/bin/pawzrta ]; then
	    $PERFCAP_LIBRARY/bin/pawzrta -stop
	fi
	;;
*)
	echo "usage: $0 {start|stop}"
	exit 1
	;;
esac
exit 0
