Update temp.inc.sh
This commit is contained in:
@@ -335,7 +335,7 @@ CHECKTEMP_SERVICE(){
|
|||||||
done
|
done
|
||||||
[ ${s_count} -eq ${#SENSORS_CHECKED[@]} ] && completed=true
|
[ ${s_count} -eq ${#SENSORS_CHECKED[@]} ] && completed=true
|
||||||
if [ $(($(date +%s)-scanstart)) -gt 300 ]; then
|
if [ $(($(date +%s)-scanstart)) -gt 300 ]; then
|
||||||
SENDNOTICE "PW Scan Stuck" "NMG Status scan has been running for 5mins, try breaking...." 1
|
SENDNOTICE "PW Scan Stuck" "PW Temp scan has been running for 5mins, try breaking...." 1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -623,16 +623,24 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
|
|
||||||
#### LOGGING OF SERVERROOM SENSOR DIFFERENCE
|
#### LOGGING OF SERVERROOM SENSOR DIFFERENCE
|
||||||
if [ "${SENSOR}" == "ServerRoomLA-Probe" ]; then
|
if [ "${SENSOR}" == "ServerRoomLA-Probe" ]; then
|
||||||
# if [ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.log.sr.difference)) -ge 300 ]; 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}" != "" ] && [ "${ServerRoomTH}" != "" ]; then
|
if [ "${temp_f}" != "" ] && [ "${ServerRoomTH}" != "" ]; then
|
||||||
|
echo -en "temp good"
|
||||||
[ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] && touch ${PW_TMPFOLDER}/.log.sr.difference
|
[ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] && touch ${PW_TMPFOLDER}/.log.sr.difference
|
||||||
temp_difference=$(bc <<< "scale=2; ${ServerRoomTH}-${temp_f}")
|
temp_difference=$(bc <<< "scale=2; ${ServerRoomTH}-${temp_f}")
|
||||||
# (( $(bc <<<"${temp_difference} < 0") )) && temp_difference=`echo "scale=2; ${temp_difference} * -1" | bc`
|
# (( $(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_difference}" >> ${PW_TMPFOLDER}/.log.sr.difference
|
||||||
echo "[$(date +'%Y-%m-%d %H:%M:%S')] ${temp_f} - ${ServerRoomTH} = ${temp_difference}"
|
echo "[$(date +'%Y-%m-%d %H:%M:%S')] ${temp_f} - ${ServerRoomTH} = ${temp_difference}"
|
||||||
|
else
|
||||||
|
echo "temp not good"
|
||||||
fi
|
fi
|
||||||
# fi
|
else
|
||||||
|
echo "logs not good"
|
||||||
|
fi
|
||||||
elif [ "${SENSOR}" == "ServerRoomTH" ]; then
|
elif [ "${SENSOR}" == "ServerRoomTH" ]; then
|
||||||
|
echo "srth found"
|
||||||
export ServerRoomTH=${temp_f}
|
export ServerRoomTH=${temp_f}
|
||||||
fi
|
fi
|
||||||
###################
|
###################
|
||||||
|
|||||||
Reference in New Issue
Block a user