#!/bin/bash
which ipmitool >/dev/null 2&>1
if [ $? -ne 1 ];then
	yum install -y *ipmi* *IPMI*
else
	echo "ipmitool is already installed"
fi
service ipmi restart
Asset_tag=`ipmitool fru |awk '/Product Asset Tag/{print $NF}'`
if [[ $(uname -r |awk -F"." '{print $2}') == 1 ]];then
	./amidelnx_26_64 /MAKEDRV
	./amidelnx_26_64 /ca ${Asset_tag}
elif [[ $(uname -r |awk -F"." '{print $2}') == 14 ]];then
	./amidelnx_64_4.14 /MAKEDRV
	./amidelnx_64_4.14 /ca ${Asset_tag}
elif [[ $(uname -r |awk -F"." '{print $2}') == 10 ]];then
        ./amidelnx_64_5.27.02.0006 /MAKEDRV
        ./amidelnx_64_5.27.02.0006 /ca ${Asset_tag}
fi
