#!/bin/bash
chmod 777 afulnx_64_4.14 afulnx_64_5.14.03.0039_2021
chmod 777 *.bin
kernel_pre_version=`uname -r |awk -F"." '{print $1}'`
kernel_sub_version=`uname -r |awk -F"." '{print $2}'`
PN=`dmidecode -s system-product-name`

if [[ "$PN" =~ "X640 G30" ]];then
	if [[ ${kernel_pre_version} == 4 ]];then
		./afulnx_64_4.14 /MAKEDRV
		./afulnx_64_4.14 UQYS011A18-U04.bin /p /b /n /x /me
	elif [[ ${kernel_pre_version} == 5 ]];then
		if [[ ${kernel_sub_version} == 10 ]];then
                	./afulnx_64_5.14.03.0039_2021 UQYS011A18-U04.bin /p /b /n /x /me
        	fi
	fi
fi
