#!/bin/sh
#
#  This script removes blank lines from
#  $ROOTDIR/var/sadm/pkg/SUNWcsr/install/space.  Although the
#  space file is only used during initial SunOS installation, presence
#  of blank lines interfere with installation of SUNWcsr patches.
#
#  This script check if SIMs product is installed which is incompatible to 
#  sendmail patch.

	Date=`date +%m%d%y%M`
	if test -f $ROOTDIR/var/sadm/pkg/SUNWcsr/install/space
        then
	    cd $ROOTDIR/var/sadm/pkg/SUNWcsr/install
	       if `ls space.* > /dev/null 2>&1 `; then
	       rm space.* 
               fi
            sed '/^$/d' space > space.$Date
	    cp -p space.$Date space
	fi


        pkginfo -R / -q SUNWbbmta
        status=$?
        SUNWbbmta=$status
        pkginfo -R / -q SUNWimmta
        status=$?
        SUNWimmta=$status
        if [ $SUNWbbmta -eq 0 -o $SUNWimmta -eq 0 ]
        then
            echo "This system contains a SIMs product which is incompatible"
            echo "to sendmail patch"
            exit 1
        fi

exit 0
