From 3710481735a5ca9def3ad8ff1c076a7ce2e21915 Mon Sep 17 00:00:00 2001 From: leimingsheng Date: Fri, 4 Jul 2025 15:03:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(master=20:=20nicsensor)=E4=BC=98=E5=8C=96tr?= =?UTF-8?q?y=5Fget=5Fserver=5Ftype=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nicsensor.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nicsensor.sh b/nicsensor.sh index c664163..2a17e5c 100755 --- a/nicsensor.sh +++ b/nicsensor.sh @@ -259,6 +259,12 @@ try_get_server_type(){ else boardid=`cat /proc/cmdline | awk -F 'boardid=' '{split($2, a," "); print a[1]}'` + if [ "$boardid" = "" ];then + server_type="Unknown" + format_print $WARNING "Can't find boardid, auto work failed" + format_print $INFO "Please modify server_type in script manually!" + return + fi if [ $boardid -eq 130 ];then server_type="5280m7" elif [ $boardid -eq 150 ];then @@ -267,7 +273,7 @@ try_get_server_type(){ server_type="5688m7" else format_print $ERROR "Invalid boardid value: $boardid" - format_print $ERROR "Can't specify server type by general method" + format_print $ERROR "Can't specify server type by auto method" format_print $INFO "Please modify server_type in script manually!" exit 1 fi