# Copyright 1994 Sun Microsystems, Inc. All Rights Reserved.
#
# Copyright (c) 1993 by Sun Microsystems, Inc.
#
#

#ident  "@(#)preremove 1.8     94/07/07" 
 
#
# Return pid of named process in variable "pid"
#
 
pidproc() {
        pid=`/usr/bin/ps -e |
                /usr/bin/grep $1 |
                /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
}
 
pidproc snmpd
 
if [ "$pid" != "" ]; then
        echo 'Killing snmpd'
        kill -9 $pid
fi
 
pidproc snmpv2d

if [ "$pid" != "" ]; then
        echo 'Killing snmpv2d'
        kill -9 $pid
fi

if [ -d /etc/opt/SUNWconn/snm/agent ]; then
	rm -rf /etc/opt/SUNWconn/snm/agent
fi
if [ -d /etc/opt/SUNWconn/snm/manager ]; then
	rm -rf /etc/opt/SUNWconn/snm/manager
fi
if [ -d $BASEDIR/SUNWconn/snm/agents/configs ]; then
	rm -rf $BASEDIR/SUNWconn/snm/agents/configs
fi
exit 0 

