#! /bin/sh
#
# ident	"@(#)preremove	1.1	03/05/01 SMI"
#
# Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

#
# Check if svm, svm2, or svm3 exist in /var/sadm/wbem/logr/preReg.
# If they are found, they must be removed so that they don't get registered
# after the package is removed.
#
if [ -d ${BASEDIR}/var/sadm/wbem/logr/preReg/svm ];
then
	rm -r ${BASEDIR}/var/sadm/wbem/logr/preReg/svm
fi

if [ -d ${BASEDIR}/var/sadm/wbem/logr/preReg/svm2 ];
then
	rm -r ${BASEDIR}/var/sadm/wbem/logr/preReg/svm2
fi

if [ -d ${BASEDIR}/var/sadm/wbem/logr/preReg/svm3 ];
then
        rm -r ${BASEDIR}/var/sadm/wbem/logr/preReg/svm3
fi

#
# Once mofs are registered, they get placed in the /var/sadm/wbem/logr/unregDir
# directory.  We need to check if svm, svm2, or svm3 is registered on the
# machine by checking that directory.  If any of the svm mofs are found to be
# registered, they must be set up to be unregistered by being placed in
# /var/sadm/wbem/logr/preUnreg.  This unregisters the mof upon the next stop
# and restart of the CIMOM.
#
if [ -d ${BASEDIR}/var/sadm/wbem/logr/unregDir/svm ];
then
	mkdir -p ${BASEDIR}/var/sadm/wbem/logr/preUnreg/svm
fi

if [ -d ${BASEDIR}/var/sadm/wbem/logr/unregDir/svm2 ];
then
        mkdir -p ${BASEDIR}/var/sadm/wbem/logr/preUnreg/svm2
fi

if [ -d ${BASEDIR}/var/sadm/wbem/logr/unregDir/svm3 ];
then
        mkdir -p ${BASEDIR}/var/sadm/wbem/logr/preUnreg/svm3
fi

exit 0
