Update temp.inc.sh

This commit is contained in:
2023-12-29 15:59:54 -06:00
parent 143aa9027c
commit fbad7d0f24

View File

@@ -309,6 +309,7 @@ CHECKTEMP_SERVICE(){
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - 'Check Temp' Service Startup" >> ${PW_LOGFILE}
SENDTEMPS "TEMP Service Startup" &
while true; do
start=$(date +%s); echo starting
source ${PW_FOLDER}/defaults.inc
# time="$(date +%H)$(date +%M)"
@@ -323,7 +324,7 @@ CHECKTEMP_SERVICE(){
CHECKTEMP_SERVICE_RUNSENSOR ${SENSORa} &
SENSORS_CHECKED+=(${SENSORa})
done
s_count=0; completed=false
s_count=0; completed=false; scanstart=$(date +%s)
until [ "${completed}" == "true" ]; do
for sensor in ${PW_TMPFOLDER}/zservicerun.*.done; do
if [ "$(grep -oP '(?<=zservicerun.).*?(?=.done)' <<< "${sensor}")" != "*" ]; then
@@ -332,8 +333,13 @@ CHECKTEMP_SERVICE(){
fi
done
[ ${s_count} -eq ${#SENSORS_CHECKED[@]} ] && completed=true
if [ $(($(date +%s)-scanstart)) -gt 300 ]; then
SENDNOTICE "PW Scan Stuck" "NMG Status scan has been running for 5mins, try breaking...." 1
break
fi
done
sleep 10s
end=`date +%s`; runtime=$((end-start)); echo -e "Runtime: ${runtime}s... sleeping for 5secs..."
sleep 5s
done # &
${PW_TMPFOLDER}/zservicerun.${SENSORa}.done
}