From 3a15c90acf548c7ce419dbccb599b28d54567be7 Mon Sep 17 00:00:00 2001 From: leimingsheng Date: Wed, 11 Mar 2026 14:09:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(master=20:=20nicsensor)=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=85=8D=E7=BD=AE=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE?= =?UTF-8?q?fru=20offset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nicsensor.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nicsensor.sh b/nicsensor.sh index bdb1719..a574e73 100755 --- a/nicsensor.sh +++ b/nicsensor.sh @@ -249,7 +249,7 @@ print_usage(){ echo " Function 5 - Properties Settings" echo " 1) Command Format : ./nicsensor.sh [get/set] [property] [value]" echo " 2) Option Detail" - echo " - [property] : debug, n_detect, server, fru_size, i2cbus" + echo " - [property] : debug|n_detect|server|fru_size|fru_offset|i2cbus" echo " - [value] : property's value" echo " 3) E.G. : ./nicsensor.sh set server 5280m7" echo " : ./nicsensor.sh set debug 1" @@ -382,6 +382,9 @@ get_set_properties(){ elif [ "$Param2" = "fru_size" ];then target_file="${CONFIG_DIR}ns_frusize" default_data=$fru_size + elif [ "$Param2" = "fru_offset" ];then + target_file="${CONFIG_DIR}ns_fruoffset" + default_data=$fru_offset elif [ "$Param2" = "i2cbus" ];then target_file="${CONFIG_DIR}ns_i2cbus" default_data=$i2c_bus @@ -422,6 +425,10 @@ load_properties_from_cache(){ fru_size=`cat ${CONFIG_DIR}ns_frusize` fi + if [ -e "${CONFIG_DIR}ns_fruoffset" ];then + fru_offset=`cat ${CONFIG_DIR}ns_fruoffset` + fi + if [ -e "${CONFIG_DIR}ns_i2cbus" ];then i2c_bus=`cat ${CONFIG_DIR}ns_i2cbus` fi