#!/bin/sh
#
# This script edits the postremove file in the /var/sadm/pkg/SUNWwbcou/install
# directory and then copies it to /var/sadm/pkg/SUNWwbcor/install.
# The edit fixes bug 4374771.
#

Date=`date +%m%d%y%M`
if test -d $ROOTDIR/var/sadm/pkg/SUNWwbcor
then
	if test -f $ROOTDIR/var/sadm/pkg/SUNWwbcou/install/postremove
	then
		cd $ROOTDIR/var/sadm/pkg/SUNWwbcou/install
		if `ls postremove.* > /dev/null 2>&1 `; then
			rm postremove.*
		fi
		sed 's@LOGDIR=/var/sadm/wbem@LOGDIR=\${BASEDIR}/var/sadm/wbem@g' postremove > postremove.$Date
		cp -p postremove.$Date $ROOTDIR/var/sadm/pkg/SUNWwbcor/install/postremove
		rm postremove.* postremove
	fi
fi
