#!/bin/bash

. ./param_bash.ini

########################location of file to extract############################

echo -n "Please enter the location of the Oracle software media files  [$IKIT_FTP_DIR]:"
read ans
if [ "$ans" != "" ] ; then
	IKIT_FTP_DIR=$ans
fi

if [ ! -f ${IKIT_FTP_DIR}/${EXLORA}.tar.gz_aa ] ; then
	ERROR "The files ${IKIT_FTP_DIR}/${EXLORA}.tar.gz_* do not exist" "ikit_3_1"
fi

Update_params "IKIT_FTP_DIR" "${IKIT_FTP_DIR}"

########################extracting#############################################
cd ${ORACLE_BASE}/product
WAIT "Extracting Oracle software"
cat ${IKIT_FTP_DIR}/${EXLORA}.tar.gz_* | ${TAR} -xzvf - >> $gen_log 2>&1

if [ "$?" != "0" ]  && [ "$?" != "2" ] ; then
	mv ${ORACLE_BASE}/product/${ORACLE_VER} ${ORACLE_BASE}/product/${ORACLE_VER}.temp
	rm -rf ${ORACLE_BASE}/product/${ORACLE_VER}.temp >> $gen_log 2>&1 &
	ERROR "Can not extract the Oracle software" "ikit_3_1"
fi
chmod 6751 $ORACLE_BASE/product/$ORACLE_VER/bin/oracle

exit 0




