Update powerwall.sh

This commit is contained in:
2023-05-14 20:10:04 -05:00
parent 519b741efd
commit af2ecdd90a

View File

@@ -19,9 +19,18 @@ CHECKTEMP(){
echo -e "${idsCL[Yellow]}Sensor Temperature(s) ${idsCL[Green]}normal${idsCL[Default]}/${idsCL[Yellow]}warning${idsCL[Default]}/${idsCL[Red]}critical${idsCL[Default]}"
DIVIDER
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 -e "${idsCL[LightCyan]}${1}${spc}${idsCL[Default]}: ${reading}"
# reading=$(CHECKTEMPSENSOR ${1})
# c=0; spc=''; spc1=`expr ${cw} - ${#1}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
# echo -e "${idsCL[LightCyan]}${1}${spc}${idsCL[Default]}: ${reading}"
for SENSOR in ${!SENSOR_ID[@]}; do
if [[ "${SENSOR}" = *"${1}"* ]]; then
reading=$(CHECKTEMPSENSOR ${SENSOR})
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -e "${idsCL[LightCyan]}${SENSOR}${spc}${idsCL[Default]}: ${reading}"
fi
done
else
for SENSOR in ${!SENSOR_ID[@]}; do
reading=$(CHECKTEMPSENSOR ${SENSOR})