#!/bin/sh
#
#       This script saves the original audit_[event|class] so that
#	customizations made are not lost when the new audit_[event|class]
#       is laid down by the patch. 
#

AUDIT_EVENT=""
AUDIT_EVENT_BK=""
AUDIT_CLASS=""
AUDIT_CLASS_BK=""

Date=`date +%m%d%y%M`

if [ -f $ROOTDIR/etc/security/audit_event -o \
             -f $ROOTDIR/etc/security/audit_class ] ; then 

        if [ -f $ROOTDIR/etc/security/audit_event ]; then
                cp -p $ROOTDIR/etc/security/audit_event $ROOTDIR/etc/security/audit_event.$Date
                AUDIT_EVENT=/etc/security/audit_event
                AUDIT_EVENT_BK=/etc/security/audit_event.$Date
        fi

        if [ -f $ROOTDIR/etc/security/audit_class ]; then
                cp -p $ROOTDIR/etc/security/audit_class $ROOTDIR/etc/security/audit_class.$Date
                AUDIT_CLASS=/etc/security/audit_class
                AUDIT_CLASS_BK=/etc/security/audit_class.$Date
        fi

        
	echo
	echo "    NOTICE: The following file(s) are being replaced by this patch:"
       	echo "  "
       	echo "                 $AUDIT_EVENT"
       	echo "                 $AUDIT_CLASS"
        echo "\n"
        echo "    Copies of the file(s) have been saved under the name(s):"
        echo "\n"
        echo "                 $AUDIT_CLASS_BK"
        echo "                 $AUDIT_EVENT_BK"
        echo "\n"
        echo "    The saved file(s) need to be scrutinized for any customizations"
        echo "    that may have been made.  Please merge these modifications"
        echo "    into the new file(s) delivered by this patch."
	echo
fi

exit 0
