#!/bin/sh
#
# Copyright (c) 2001, PerfCap Corporation, Nashua NH
# All Rights Reserved
#
# Sun Kit Install: Preremove script () if running stop collector
#---------------------------------------------------------------

  IMAGE=/opt/perfcap/bin/ecap_monitor

  RUN_IMAGE="`ps -e | grep ecap_mon`"
  if [ -n "${RUN_IMAGE}" ]
  then
       echo "ecap_monitor running. Executing stop command..."
       $IMAGE -stop
       sleep 1
  fi

 if [ "$OSREL" = "5.9" ] || [ "$OSREL" = "5.8" ] || [ "$OSREL" = "5.7" ]
 then
    echo " "
 else
    if [ -f  /var/svc/manifest/application/perfcap.xml ]
    then
      /usr/sbin/svccfg delete -f perfcap
    fi
 fi

  exit 0
