Update powerwall.sh
This commit is contained in:
@@ -39,8 +39,7 @@ CHECKTEMP(){
|
||||
for sensordata in "${vHOSTDATA[@]}"; do
|
||||
vSENSOR=$(echo ${sensordata} | cut -d'T' -f1 | xargs)
|
||||
temp_c=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $2}' | sed -e 's/C//g'); temp_c=${temp_c/ /}
|
||||
temp_warn=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); temp_warn=`echo ${temp_warn/ /} | awk '{print int($1+0.5)}'`
|
||||
# temp_warn=`echo ${(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g')/ /} | awk '{print int($1+0.5)}'`
|
||||
temp_warn=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); temp_warn=${temp_warn/ /}
|
||||
temp_crit=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); temp_crit=${temp_crit/ /}
|
||||
reading=$(CHECKTEMPSENSOR ${SENSOR} ${temp_c} ${temp_warn} ${temp_crit})
|
||||
c=0; spc=''; spc1=`expr ${cw} - ${#vSENSOR} - 1`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||
@@ -96,8 +95,8 @@ CHECKTEMPSENSOR(){
|
||||
elif [ "${PW_SENSOR_TYPE[${1}]}" == "esxi" ]; then
|
||||
temp_c=${2}
|
||||
temp_f=$(bc <<< "scale=2; ${temp_c}*1.8+32")
|
||||
temp_warn=$(bc <<< "scale=2; ${3}*1.8+32")
|
||||
temp_crit=$(bc <<< "scale=2; ${4}*1.8+32")
|
||||
temp_warn=$(bc <<< "scale=0; ${3}*1.8+32")
|
||||
temp_crit=$(bc <<< "scale=0; ${4}*1.8+32")
|
||||
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user