From 67b07fcf8bae75578eebbefcd69cd779c2487c4c Mon Sep 17 00:00:00 2001 From: leimingsheng Date: Wed, 11 Mar 2026 11:17:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(master=20:=20nicsensor)=20update=20to=201.?= =?UTF-8?q?9.8=201.=E6=94=AF=E6=8C=81get/set=E9=85=8D=E7=BD=AE=E9=BB=98?= =?UTF-8?q?=E8=AE=A4i2cbus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nicsensor.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nicsensor.sh b/nicsensor.sh index e16f245..bdb1719 100755 --- a/nicsensor.sh +++ b/nicsensor.sh @@ -1,6 +1,6 @@ #!/bin/sh set -eo pipefail -SCRIPT_VERSION="1.9.7" +SCRIPT_VERSION="1.9.8" # --------------------------------------------------------- # Project Feature Varible (Change if need) # --------------------------------------------------------- @@ -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" + echo " - [property] : debug, n_detect, server, fru_size, 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" = "i2cbus" ];then + target_file="${CONFIG_DIR}ns_i2cbus" + default_data=$i2c_bus else fmt_print "console" $ERROR "Invalid Property : $Param2" exit 1 @@ -418,6 +421,10 @@ load_properties_from_cache(){ if [ -e "${CONFIG_DIR}ns_frusize" ];then fru_size=`cat ${CONFIG_DIR}ns_frusize` fi + + if [ -e "${CONFIG_DIR}ns_i2cbus" ];then + i2c_bus=`cat ${CONFIG_DIR}ns_i2cbus` + fi } # According to boardid, parse server_type