Update temp.inc.sh
This commit is contained in:
@@ -306,10 +306,11 @@ AVERAGETEMP(){
|
|||||||
CHECKTEMP_SERVICE(){
|
CHECKTEMP_SERVICE(){
|
||||||
cw=20
|
cw=20
|
||||||
declare -A last_temp
|
declare -A last_temp
|
||||||
|
runEvery=10 #SECONDS
|
||||||
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - 'Check Temp' Service Startup" >> ${PW_LOGFILE}
|
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - 'Check Temp' Service Startup" >> ${PW_LOGFILE}
|
||||||
SENDTEMPS "TEMP Service Startup" &
|
SENDTEMPS "TEMP Service Startup" &
|
||||||
while true; do
|
while true; do
|
||||||
start=$(date +%s); echo starting
|
start=$(date +%s)
|
||||||
source ${PW_FOLDER}/defaults.inc
|
source ${PW_FOLDER}/defaults.inc
|
||||||
|
|
||||||
# time="$(date +%H)$(date +%M)"
|
# time="$(date +%H)$(date +%M)"
|
||||||
@@ -339,9 +340,9 @@ CHECKTEMP_SERVICE(){
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
end=`date +%s`; runtime=$((end-start))
|
end=`date +%s`; runtime=$((end-start))
|
||||||
echo -e "Runtime: ${runtime}s"
|
# echo -e "Runtime: ${runtime}s"
|
||||||
[ ${runtime} -lt 10 ] && echo "Sleeping for $(expr 10 - ${runtime})s"
|
[ ${runtime} -lt ${runEvery} ] && echo "Sleeping for $(expr ${runEvery} - ${runtime})s"
|
||||||
[ ${runtime} -lt 10 ] && sleep $(expr 10 - ${runtime})s
|
[ ${runtime} -lt ${runEvery} ] && sleep $(expr ${runEvery} - ${runtime})s
|
||||||
done # &
|
done # &
|
||||||
${PW_TMPFOLDER}/zservicerun.${SENSORa}.done
|
${PW_TMPFOLDER}/zservicerun.${SENSORa}.done
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user