This commit is contained in:
2024-04-22 19:21:57 -05:00
parent 4d82cb9441
commit 878f03f1da
2 changed files with 30 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='2.7.7-04222024'
VERS='2.7.8-04222024'
noheader=' update service dailytemp confsync -r -report '

View File

@@ -137,6 +137,19 @@ CHECKTEMP(){
else
reading="${reading} "
fi
if [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 ]; then
if [ $(bc -l <<< "${temp_f} <= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "${temp_f} >= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)-${PW_TEMPIND_DIFF}" | bc)") -eq 1 ]; then
reading="${reading} ${idsCL[LightCyan]}\u23F9 "
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then
reading="${reading} ${idsCL[LightRed]}\u25B2 "
elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)") -eq 1 ]; then
reading="${reading} ${idsCL[LightGreen]}\u25BC "
else
reading="${reading} "
fi
else
reading="${reading} "
fi
elif [ "${avgdays}" = "noavg" ]; then
reading="${reading} "
fi
@@ -179,7 +192,7 @@ CHECKTEMP(){
fws=10
tmp="${spca}${average_disp}${GAUGESH}"
else
fws=18
fws=15
tmp="${spct}${temp_f_disp}${GAUGESH}"
fi
c=0; spc=''; spc1=`expr ${fws} - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
@@ -302,7 +315,7 @@ CHECKTEMP(){
reading="${lclr}${lmd}${spct}${temp_f}${GAUGESH}"
echo -en "${idsCL[LightCyan]} ${sensorname}${spc}${idsCL[Default]}: ${reading}"
if [ "${average}" = "" ] && [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old ]; then
if [ "${temp_f}" != "" ] && [ "${average}" = "" ] && [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old ]; then
if [ $(bc -l <<< "${temp_f} <= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "${temp_f} >= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)-${PW_TEMPIND_DIFF}" | bc)") -eq 1 ]; then
echo -en " ${idsCL[LightCyan]}\u23F9 "
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then
@@ -312,6 +325,19 @@ CHECKTEMP(){
else
echo -en " "
fi
if [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 ]; then
if [ $(bc -l <<< "${temp_f} <= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "${temp_f} >= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)-${PW_TEMPIND_DIFF}" | bc)") -eq 1 ]; then
echo -en " ${idsCL[LightCyan]}\u23F9 "
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then
echo -en " ${idsCL[LightRed]}\u25B2 "
elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)") -eq 1 ]; then
echo -en " ${idsCL[LightGreen]}\u25BC "
else
echo -en " "
fi
else
echo -en " "
fi
elif [ "${avgdays}" = "noavg" ]; then
echo -en " "
fi
@@ -334,7 +360,7 @@ CHECKTEMP(){
fi
if [ "${average}" != "" ] || [ "${temp_f}" != "" ]; then
[ "${average}" != "" ] && fws=11 || fws=18
[ "${average}" != "" ] && fws=11 || fws=15
[ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' '
[ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' '
if [ "${TTYPE}" == "fans" ]; then