feat(master : nicsensor) update to 1.9.8
1.支持get/set配置默认i2cbus
This commit is contained in:
parent
3a66d3557b
commit
67b07fcf8b
11
nicsensor.sh
11
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user