File: //var/opt/OV/bin/instrumentation/infraspi_install.sh
if [ -f /usr/bin/ksh ]
then
`#!/usr/bin/ksh`
else
`#!/bin/ksh`
fi
#
# Purpose : To install and Uninstall Infrastructure ISPI on RHEL6.x OML9.x
redhatrel=$(cat /etc/redhat-release)
installcheck=$(./oainstall.sh -inv -includespi | grep HPSpiSysI)
value=${installcheck##*:}
if [[ $redhatrel == *5* ]]
then
echo "INFO: Continue InfraSPI installation with oainstall.sh "
exit
fi
if [ $value == 11.11 ] && [ "$1" == "-i" ] >/dev/null 2>&1
then
echo "INFO: Continue with the patch installation using oainstall.sh"
echo "INFO: Same or Higher version of InfraSPI is already installed."
exit
fi
if [ $1 ne -r ] || [ $1 ne -i ] >/dev/null 2>&1
then
echo "INFO: Unsupported option $1"
echo "Usage: infraspi_install.sh -i| install -g|grpahs"
echo "Usage: infraspi_install.sh -r| remove -g|grpahs"
exit
elif [ "$1" == "-i" ]; then
DATE=$(date +"%m-%d-%y")
# Creating a new folder to use
mkdir /tmp/isspi_$DATE
cp integration/infraspi/LIN/Linux2.6_X64/HP*.rpm.gz /tmp/isspi_$DATE
cd /tmp/isspi_$DATE
gunzip *.gz
rpm -i --test --force HPSpiSysI.rpm 2>&1 | grep -i "is needed"
if [ "$?" == "1" ]; then
echo "INFO: This installer should be used only to provide a work around for the missing /usr/bin/ksh dependency "
exit
else
echo "INFO: Installing Product HPSpiSysI"
rpm -i --force --nodeps HPSpiSysI.rpm
echo "INFO: HPSpiSysI.rpm Installed successfully"
echo "INFO: Installing Product HPSpiClI"
rpm -i --force HPSpiClI.rpm
echo "INFO: HPSpiClI.rpm Installed successfully"
echo "INFO: Installing Product HPSpiVmI"
rpm -i --force HPSpiVmI.rpm
echo "INFO: HPSpiVmI.rpm installed successfully"
if [ "$2" == "-g" ]; then
echo "INFO: Installing Product HPSpiInfG"
rpm -i --force HPSpiInfG.rpm
echo "INFO: HPSpiInfG.rmp installed successfully"
fi
echo "INFO: InfraSPI 11.11 installed successfully... "
cd -
rm -rf /tmp/isspi_$DATE
fi
elif [ "$1" == "-r" ]; then
if [ "$2" == "-g" ]; then
echo "INFO: Removing package HPSpiInfG..."
rpm -e HPSpiInfG-11.11.025-1.x86_64
echo "INFO: HPSpiInfG uninstalled successfully"
fi
echo "INFO: Removing package HPSpiVmI..."
rpm -e HPSpiVmI-11.11.025-1.x86_64
echo "INFO: HPSpiVmI uninstalled successfully"
echo "INFO: Removing package HPSpiClI..."
rpm -e HPSpiClI-11.11.025-1.x86_64
echo "INFO: HPSpiClI uninstalled successfully"
echo "INFO: Removing package HPSpiSysI..."
rpm -e HPSpiSysI-11.11.025-1.x86_64
echo "INFO: HPSpiSysI uninstalled successfully"
echo "INFO: Infrastructure SPI 11.11 uninstalled successfully ..."
echo "INFO: InfraSPI 11.11 uninstalled successfully..."
fi