Update temp.inc.sh
This commit is contained in:
@@ -623,26 +623,18 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
||||
|
||||
#### LOGGING OF SERVERROOM SENSOR DIFFERENCE
|
||||
if [ "${SENSOR}" == "ServerRoomLA-Probe" ]; then
|
||||
echo -en "PRobe found - "
|
||||
if [ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.log.sr.difference)) -ge 300 ]; then
|
||||
echo -en "logs good - "
|
||||
if [ "${temp_f}" != "" ] && [ -f ${PW_TMPFOLDER}/.serveroomth ]; then
|
||||
echo -en "temp good"
|
||||
if [ "${temp_f}" != "" ] && [ -f ${PW_TMPFOLDER}/.serverroomth ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.serverroomth)) -lt 60 ]; then
|
||||
[ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] && touch ${PW_TMPFOLDER}/.log.sr.difference
|
||||
temp_difference=$(bc <<< "scale=2; $(cat ${PW_TMPFOLDER}/.serveroomth)-${temp_f}")
|
||||
# (( $(bc <<<"${temp_difference} < 0") )) && temp_difference=`echo "scale=2; ${temp_difference} * -1" | bc`
|
||||
# echo "$(date "+%Y-%m-%d %H:%M:%S")~${temp_difference}" >> ${PW_TMPFOLDER}/.log.sr.difference
|
||||
echo "[$(date +'%Y-%m-%d %H:%M:%S')] ${temp_f} - $(cat ${PW_TMPFOLDER}/.serveroomth) = ${temp_difference}"
|
||||
rm -f ${PW_TMPFOLDER}/.serveroomth
|
||||
else
|
||||
echo "temp not good (${temp_f} - ${ServerRoomTH})"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S")~${temp_difference}" >> ${PW_TMPFOLDER}/.log.sr.difference
|
||||
# echo "[$(date +'%Y-%m-%d %H:%M:%S')] ${temp_f} - $(cat ${PW_TMPFOLDER}/.serveroomth) = ${temp_difference}"
|
||||
rm -f ${PW_TMPFOLDER}/.serverroomth
|
||||
fi
|
||||
else
|
||||
echo "logs not good"
|
||||
fi
|
||||
elif [ "${SENSOR}" == "ServerRoomTH" ]; then
|
||||
echo ${temp_f} > ${PW_TMPFOLDER}/.serveroomth
|
||||
echo "srth found - ${ServerRoomTH}"
|
||||
echo ${temp_f} > ${PW_TMPFOLDER}/.serverroomth
|
||||
fi
|
||||
###################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user