#!/bin/bash
CPWD=`cd $(dirname  $0);pwd`
os_version=`uname -r |awk -F"el" '{print $2}' |awk -F"." '{print $1}'`
BIOS_Ver=`dmidecode -t 0 |awk '/Version/{print $NF}' |sed 's/\s*//g'`
Pro_name=`ipmitool fru print 0 |awk -F":" '/Product Name/{print $NF}' |sed 's/^\s*//g'`

IPMI_IP=`ipmitool  lan print 1 | grep "IP Address  "| awk '{print $NF}'`
SN=$(dmidecode -s system-serial-number |grep -v ^#  | sed s/[[:space:]]//g)
IPMI_pw=$1

2288H_V6(){
if [[ "${os_version}" = "7" ]] && [[ "${BIOS_Ver}" = "1.81" ]];then
     ipmitool raw 0x30 0x93 0x14 0xe3 0x00 0x35 0x52 0x00 0x01 0x00 0x00 0x00 0xff 0xff 0x00 0x01 0x00 0x04 0x00 0x00 0x01 0x00
     bash ./bin/urest -H ${IPMI_IP} -U root -P ${IPMI_pw} config -M import -F /tmp/fw_update/XFUSION/SETBIOS/2288H_V6_20241106_EFI.xml 
else
	exit 1

fi
}

if [[ "${Pro_name}" == "2288H V6" ]];then
	2288H_V6
else 
	echo "this machine don't have BIOScfg file"
	exit 1
fi

