Update powerwall.sh
This commit is contained in:
@@ -21,7 +21,7 @@ CHECKTEMP(){
|
|||||||
echo
|
echo
|
||||||
[ "${1}" != "" ] && [ "${1}" != "noavg" ] && [[ "${1}" =~ ^[0-9]+$ ]] && avgdays=${1} || avgdays=3
|
[ "${1}" != "" ] && [ "${1}" != "noavg" ] && [[ "${1}" =~ ^[0-9]+$ ]] && avgdays=${1} || avgdays=3
|
||||||
# echo -e "${idsCL[Yellow]}Sensor Temperature(s) ${idsCL[Green]}normal${idsCL[Default]} /${idsCL[Yellow]}warning${idsCL[Default]}/ ${idsCL[Red]}critical${idsCL[Default]}"
|
# echo -e "${idsCL[Yellow]}Sensor Temperature(s) ${idsCL[Green]}normal${idsCL[Default]} /${idsCL[Yellow]}warning${idsCL[Default]}/ ${idsCL[Red]}critical${idsCL[Default]}"
|
||||||
echo -e "${idsCL[Cyan]}Sensor Temperature(s) Current / ${avgdays}DayAVG ${idsCL[Yellow]}warning${idsCL[Default]} / ${idsCL[Red]}critical${idsCL[Default]}"
|
echo -e "${idsCL[Cyan]}Sensor Temperature(s) Current / ${avgdays}DayAVG ${idsCL[Yellow]}warning${idsCL[Default]} / ${idsCL[Red]}critical${idsCL[Default]}"
|
||||||
DIVIDER . yellow 90
|
DIVIDER . yellow 90
|
||||||
|
|
||||||
for SENSOR in ${PW_SENSOR_ORD[@]}; do
|
for SENSOR in ${PW_SENSOR_ORD[@]}; do
|
||||||
@@ -150,11 +150,11 @@ CHECKTEMPSENSOR(){
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then
|
if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then
|
||||||
echo -en "${idsCL[Yellow]}WARNING (${spct}${temp_f}'F / ${spca}${averagedisp}${idsCL[Yellow]})${idsCL[Default]}"
|
echo -en "${idsCL[Yellow]}WARNING (${spct}${temp_f}'F /${spca}${averagedisp}${idsCL[Yellow]})${idsCL[Default]}"
|
||||||
elif [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ]; then
|
elif [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ]; then
|
||||||
echo -en "${idsCL[Red]}CRITICAL (${spct}${temp_f}'F / ${spca}${averagedisp}${idsCL[Red]})${idsCL[Default]}"
|
echo -en "${idsCL[Red]}CRITICAL (${spct}${temp_f}'F /${spca}${averagedisp}${idsCL[Red]})${idsCL[Default]}"
|
||||||
else
|
else
|
||||||
echo -en "${idsCL[Green]}Normal (${spct}${temp_f}'F / ${spca}${averagedisp}${idsCL[Green]})${idsCL[Default]}"
|
echo -en "${idsCL[Green]}Normal (${spct}${temp_f}'F /${spca}${averagedisp}${idsCL[Green]})${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
tmp="${spct}${temp_f}"
|
tmp="${spct}${temp_f}"
|
||||||
c=0; spc=''; spc1=`expr 8 - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
c=0; spc=''; spc1=`expr 8 - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
||||||
|
|||||||
Reference in New Issue
Block a user