Update temp.inc.sh

This commit is contained in:
2023-12-26 18:57:14 -06:00
parent 8afd18ba31
commit b855f76d66

View File

@@ -21,7 +21,7 @@ CHECKTEMP(){
DIVIDER . yellow 70
for SENSOR in ${PW_SENSOR_ORD[@]}; do
start_sub=`date +%s`; echo "[$(date +'%Y-%m-%d %H:%M:%S')] ${SENSOR}"
if [ "${search}" == "" ] || [[ "${SENSOR,,}" = *"${search,,}"* ]]; then
if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "esxi" ] && [ "${temptype}" != "sensors" ]; then
@@ -88,7 +88,6 @@ CHECKTEMP(){
last_sensor=${SENSOR%%-*}
fi
fi
end_sub=`date +%s`; runtime_sub=$((end_sub-start_sub)); echo " - done: ${runtime_sub}s"
done
end=`date +%s`; runtime=$((end-start)); echo -e "\nruntime: ${runtime}"
[ "${PW_ACTION}" != "" ] && echo -e "${idsCL[Default]}"
@@ -585,15 +584,14 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
#### LOGGING OF SERVERROOM SENSOR DIFFERENCE
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
if [ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.log.sr.difference)) -ge 300 ]; then
if [ "${temp_f}" != "" ] && [ "${ServerRoomTH}" != "" ]; then
[ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] && touch ${PW_TMPFOLDER}/.log.sr.difference
temp_difference=$(bc <<< "scale=2; ${ServerRoomTH}-${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
fi
# fi
fi
elif [ "${SENSOR}" == "ServerRoomTH" ]; then
export ServerRoomTH=${temp_f}
fi
@@ -625,8 +623,8 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
end_sub=`date +%s`; runtime_sub=$((end_sub-start_sub)); echo " - done: ${runtime_sub}s"
done
end=`date +%s`; runtime=$((end-start)); echo "Total runtime: ${runtime}s, pausing for 10secs..."
sleep 10s
end=`date +%s`; runtime=$((end-start)); echo "Total runtime: ${runtime}s"
# sleep 10s
done # &
}