Update powerwall.sh

This commit is contained in:
2023-08-14 19:49:45 -05:00
parent 102d9e51bd
commit 127d559496

View File

@@ -42,7 +42,7 @@ CHECKTEMP(){
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})
# 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
echo -e "${idsCL[LightCyan]} ${vSENSOR}${spc}${idsCL[Default]}: ${reading}"
@@ -125,7 +125,7 @@ CHECKTEMPSENSOR(){
echo -en "${idsCL[Green]}Normal (${spct}${temp_f}'F / ${spca}${averagedisp}${idsCL[Green]})${idsCL[Default]}"
fi
tmp="${spct}${temp_f}"
# c=0; spc=''; spc1=`expr 10 - ${#tmp} - 2`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
c=0; spc=''; spc1=`expr 10 - ${#tmp} - 2`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
[ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' '
[ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' '
echo -e "${spc}[${spcw}${idsCL[Green]}<=$(expr ${temp_warn} - 1)'F${idsCL[Default]} /${spcw}${idsCL[Yellow]}${temp_warn}'F${idsCL[Default]} /${spcc}${idsCL[Red]}${temp_crit}'F=>${idsCL[Default]} ]"