#!/bin/bash

CPWD=`cd $(dirname  $0);pwd`
cd $CPWD
Model=`ipmitool fru list 0 |grep "Product Part Number" |cut -d ":" -f 2|sed 's/^[ \t]*//g'`
CPU_Model=`lscpu|grep "Model name"|awk '{print $5}'`
MachineType=`cat /tmp/os_init/cmdb.info |grep -i MachineType|cut -d : -f 2`

if  [[ "$MachineType" == "G2.U4.A3.34" ]] || [[ "$MachineType" == "G9.U4.A3.34" ]] ;then	
	./sum -c ChangeBiosCfg --file KA4224G-HS3_A3_20231122.cfg --skip_unknown --skip_bbs
	exit $?
    elif [[ $Model = "KA4224G-HS3" ]] && [[ "$MachineType" == "G2.U4.A2.34" ]];then
        ./sum -c ChangeBiosCfg --file KA4224G-HS3_A2_20231123.cfg --skip_unknown --skip_bbs
	 exit $?
    elif [[ $Model = "KA4224G-HS3" ]] && [[ "$MachineType" == "G1.U4.A3.34" ]];then
	./sum -c ChangeBiosCfg --file KA4224G-HS3_A3_20231226_nps1.cfg --skip_unknown --skip_bbs
	 exit $?	
    elif [[ $Model = "KI4224G-HS2" ]];then
	./sum -c ChangeBiosCfg --file  KI4224G-HS2_20240112.cfg --skip_unknown --skip_bbs
    elif [[ $Model = "KA4224G-HS2" ]];then
	 echo "ucloud only 1 ,break"
    else  
	 exit $?
fi
