#!/bin/bash
CPWD=`cd $(dirname  $0);pwd`
#os_version=`uname -r |awk -F"el" '{print $2}' |awk -F"." '{print $1}'`
kernel_pre_version=`uname -r |awk -F"." '{print $1}'`
kernel_sub_verison=`uname -r |awk -F"." '{print $2}'`
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'`

cd $CPWD
if [[ "${Pro_name}" == "A620-G30" ]] && [[ "${BIOS_Ver}" == "UZZQ012113" ]];then
	if [[ ${kernel_pre_version} == 4 ]];then
		./SCELNX_64 /i /s A620_G30_bios.cfg
		#12113定制版本固件
	else 
		if [[ ${kernel_pre_version} == 5 ]];then
		#if [[ ${kernel_sub_version} == 10 ]];then
		./SCELNX_64_5.05.01.0002_2021 /i /s A620_G30_bios.cfg
		fi
	fi
fi

# A3 更新UEFI启动模式
if [[ "${Pro_name}" == "R6240A0" ]] && [[ "${BIOS_Ver}" == "UXWH012201" ]];then
	./SCELNX_64_5.05.01.0002_2021 /i /s R6240A0_250601_EFI.cfg 
else
	echo "Please check your kernel version its maybe lower..."
fi

