#!/bin/sh
#
#ident	"@(#)preinstall 1.2     03/03/21 SMI"
#
#	preinstall script for package: SUNWwbcor
#

# Exit codes for installation scripts 
e_ok=0      
e_fatal=1      # stop installation on this exit
e_warning=2    # Installation will go on. 
e_int=3        # Interrupted. Stop installation
e_reboot=10    # User must reboot after installation of all selected packages
e_rebootnow=20 # User must reboot right after installation of current package
               # To be added to one of the single-digit exit code above
# Trap interrupt
trap `exit $e_int` 15

#
#	Stop running process(es)
#
LOGDIR=${BASEDIR}/var/sadm/wbem

if [ -d ${LOGDIR}/log ]; then
    if [ ! -d ${LOGDIR}/logprepatch ]; then
        /usr/bin/mv ${LOGDIR}/log ${LOGDIR}/logprepatch 2>/dev/null
    fi
fi 


# Remove old backed up log; Backup the existing log; S8 only
if [ -f ${LOGDIR}/logr/store ] && [ ! -d ${LOGDIR}/logr/regDir ]; then
    /usr/bin/rm -rf ${LOGDIR}/logru3
    /usr/bin/mkdir -m 755 ${LOGDIR}/logru3
    for i in ${LOGDIR}/logr/*; do
	/usr/bin/mv $i ${LOGDIR}/logru3 
    done
fi

exit $e_ok 
