#!/bin/ksh
if test -x /usr/ucb/whoami
then
/usr/ucb/whoami | read USERID
else
USERID=root
fi
if [ "$USERID" != root ]
then
echo "You have to be root to install any component!"
echo "Installation aborted"
exit 1
fi
if ! test -a ./IP22293.pkg
then
echo "Cannot find the following file: IP22293.pkg"
echo "Please download to this directory."
echo "Aborting installation."
exit 1
fi
if ! test -a ./IP22297.pkg
then
echo "Cannot find the following file: IP22297.pkg"
echo "Please download to this directory."
echo "Aborting installation."
exit 1
fi
if ! test -a ./admin
then
echo "Cannot find the following file: admin"
echo "Please download to this directory."
echo "Aborting installation."
exit 1
fi
pkginfo IMinerCnv > /dev/null 2>/dev/null
if test $? -eq 0
then
echo "Updating IMinerCnv package"
pkgadd -a ./admin -d ./IP22297.pkg IMinerCnv
echo "Installing Oracle support"
pkgadd -a ./admin -d ./IP22293.pkg IMinerScO
else
echo "No Conversion Utilities installation found, aborting."
exit 1
fi
echo "Installation completed successful."
exit 0
