Update powerwall.sh
This commit is contained in:
@@ -746,7 +746,7 @@ CHECKPOWER(){
|
|||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
read -rd '' -a HOST_WATT_SENSORS <<<"${HOST_WATT_SENSORS}"
|
read -rd '' -a HOST_WATT_SENSORS <<<"${HOST_WATT_SENSORS}"
|
||||||
unset IFS
|
unset IFS
|
||||||
found=0
|
found=0; PS1='0.0'; PS2='0.0'
|
||||||
for s in {1..5}; do
|
for s in {1..5}; do
|
||||||
DP=$(snmpwalk -t 1 -r 0 -v 1 -c public ${PW_HOST_IDRACS[${SENSOR}]} iso.3.6.1.4.1.674.10892.5.4.600.30.1.8.1.${s} | sed 's/.*: //')
|
DP=$(snmpwalk -t 1 -r 0 -v 1 -c public ${PW_HOST_IDRACS[${SENSOR}]} iso.3.6.1.4.1.674.10892.5.4.600.30.1.8.1.${s} | sed 's/.*: //')
|
||||||
if [[ "${DP}" = *"System Board"* ]]; then
|
if [[ "${DP}" = *"System Board"* ]]; then
|
||||||
@@ -774,8 +774,8 @@ CHECKPOWER(){
|
|||||||
average=$(AVERAGEPOWER ${PW_POWERSENSOR_ID[${SENSOR}]} ${avgdays}); average_disp="${idsCL[LightYellow]} `IDS_NUMBER_FORMAT ${average}`'watts"
|
average=$(AVERAGEPOWER ${PW_POWERSENSOR_ID[${SENSOR}]} ${avgdays}); average_disp="${idsCL[LightYellow]} `IDS_NUMBER_FORMAT ${average}`'watts"
|
||||||
echo -en "\r\033[K"; echo -en "${MSG}${idsCL[LightYellow]}${average_disp}"
|
echo -en "\r\033[K"; echo -en "${MSG}${idsCL[LightYellow]}${average_disp}"
|
||||||
elif [ "${HOST_WATTS}" != "0" ]; then
|
elif [ "${HOST_WATTS}" != "0" ]; then
|
||||||
[ "${PS1}" == "" ] && PS1='0.0' || PS1=`echo "scale=1; ${PS1}/10" | bc`; (( $(bc <<<"${PS1} < 1") )) && [[ "${PS1}" = *"."* ]] && PS1="0${PS1}"
|
[ "${PS1}" != "0.0" ] && PS1=`echo "scale=1; ${PS1}/10" | bc` && (( $(bc <<<"${PS1} < 1") )) && [[ "${PS1}" = *"."* ]] && PS1="0${PS1}"
|
||||||
[ "${PS2}" == "" ] && PS2='0.0' || PS2=`echo "scale=1; ${PS2}/10" | bc`; (( $(bc <<<"${PS2} < 1") )) && [[ "${PS2}" = *"."* ]] && PS2="0${PS2}"
|
[ "${PS2}" != "0.0" ] && PS2=`echo "scale=1; ${PS2}/10" | bc` && (( $(bc <<<"${PS2} < 1") )) && [[ "${PS2}" = *"."* ]] && PS2="0${PS2}"
|
||||||
echo -en "${idsCL[LightCyan]} [PS1=${PS1}'A, PS2=${PS2}'A]"
|
echo -en "${idsCL[LightCyan]} [PS1=${PS1}'A, PS2=${PS2}'A]"
|
||||||
fi
|
fi
|
||||||
echo -e "${idsCL[Default]}"
|
echo -e "${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user