#!/bin/sh
#

echo      "The following links from the SUNWvolr package are being removed."


if [ "$ROOTDIR" != "" ]; then
	REMOVEF="removef -R ${ROOTDIR}"
else
	REMOVEF="removef"
fi

${REMOVEF} SUNWvolr /etc/rcS.d/K35volmgt

${REMOVEF} SUNWvolr /etc/rc2.d/S92volmgt

${REMOVEF} SUNWvolr /etc/rc1.d/K35volmgt 

${REMOVEF} SUNWvolr /etc/rc0.d/K35volmgt

${REMOVEF} -f SUNWvolr || exit 2


if [ "$ROOTDIR" != "" ]; then
	INSTALLF="installf -R ${ROOTDIR}"
else
	INSTALLF="installf"
fi

	${INSTALLF} -c initd SUNWvolr /etc/rc0.d/K05volmgt=${ROOTDIR}/etc/init.d/volmgt l

	${INSTALLF} -c initd SUNWvolr /etc/rc1.d/K05volmgt=${ROOTDIR}/etc/init.d/volmgt l
	
	${INSTALLF} -c initd SUNWvolr /etc/rc2.d/K05volmgt=${ROOTDIR}/etc/init.d/volmgt l

	${INSTALLF} -c initd SUNWvolr /etc/rc3.d/S81volmgt=${ROOTDIR}/etc/init.d/volmgt l

	${INSTALLF} -c initd SUNWvolr /etc/rcS.d/K05volmgt=${ROOTDIR}/etc/init.d/volmgt l

${INSTALLF} -f SUNWvolr

### 4892034 Audited system calls hang if auditd killed when audit_policy == 0x5 (argv, cnt)

STARTUP=$ROOTDIR/etc/security/audit_startup
STARTUPTMP=$ROOTDIR/etc/security/audit_startup.tmp

# Check to see if the audit_startup file exists
if [ -f ${STARTUP} ]; then

    # If audit_startup exists, then remove 'setpolicy none' string
    /usr/bin/grep -v 'auditconfig -setpolicy none' $STARTUP > $STARTUPTMP
    /usr/bin/mv $STARTUPTMP $STARTUP
    /usr/bin/chmod 0744 $STARTUP
fi

