#!/bin/sh

OH=`echo $ORACLE_HOME`

#Checking if this is "apply" action

if [ "$1" = "-apply" ]
then
        TIME=`date +%d"-"%m"-"%Y"_"%H"-"%M"-"%S`
        if [ -s $OH/inventory/filemap/Apache/Jserv/libexec/files.map ]
        then

                #Check if the inventory contains file.map entry for 9207 JulCpu ( bugno 4547566 ).
                #If so clear the entry by taking a backup of the file.

                grep 4547566 $OH/inventory/filemap/Apache/Jserv/libexec/files.map > /dev/null
                if [ $? -eq 0 ]
                then
                        mv $OH/inventory/filemap/Apache/Jserv/libexec/files.map $OH/inventory/filemap/Apache/Jserv/libexec/files.map.$TIME
                        sed '/4547566/d' $OH/inventory/filemap/Apache/Jserv/libexec/files.map.$TIME > $OH/inventory/filemap/Apache/Jserv/libexec/files.map
                fi
        fi
fi

c=0
r=0
if  [ -d $OH/cpu/CPUOct2005 ]
then
c=1;
fi
if [ ! -d $OH/cpu/CPUOct2005/.rollbacked ]
then
r=1;
fi
if [ $c -eq 1  -a $r -eq 1  ]
then
mv $OH/cpu/CPUOct2005 $OH/cpu/CPUOct2005_rollback
fi
