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