Update powerwall.sh

This commit is contained in:
2023-05-14 17:25:42 -05:00
parent f8631110bb
commit 45e5ed1482

View File

@@ -20,12 +20,12 @@ CHECKTEMP(){
if [ "${1}" != "" ]; then
reading=$(CHECKTEMPSENSOR ${1})
c=0; spc=''; spc1=`expr ${cw} - ${#1}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo "${1}${spc}: ${reading}"
echo -e "${idsCL[LightCyan]}${1}${spc}${idsCL[Default]}: ${reading}"
else
for SENSOR in ${!SENSOR_ID[@]}; do
reading=$(CHECKTEMPSENSOR ${SENSOR})
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo "${SENSOR}${spc}: ${reading}"
echo -e "${idsCL[LightCyan]}${SENSOR}${spc}${idsCL[Default]}: ${reading}"
done
fi
echo
@@ -42,11 +42,11 @@ CHECKTEMPSENSOR(){
echo ${TEMP_THRESHOLDS[${1}]} | cut -d',' -f 2 | read temp_crit
if [ $(bc -l <<< "$temp_f >= $temp_warn") -eq 1 ] && [ $(bc -l <<< "$temp_f < $temp_crit") -eq 1 ]; then
echo "WARNING: $temp_f°F"
echo -e "${idsCL[LightMagenta]}WARNING: $temp_f°F${idsCL[Default]}"
elif [ $(bc -l <<< "$temp_f >= $temp_crit") -eq 1 ]; then
echo "CRITICAL: $temp_f°F"
echo -e "${idsCL[Red]}CRITICAL: $temp_f°F${idsCL[Default]}"
else
echo "normal: $temp_f°F"
echo -e "${idsCL[Green]}normal: $temp_f°F${idsCL[Default]}"
fi
fi
}