From 5f56848d9907e8c50c669f583d9b90765e4a47a3 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 1 Jan 2024 12:36:35 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- inc/temp.inc.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults.inc b/defaults.inc index 9351460d..b6816bea 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ -VERS='2.5.98-01012024' +VERS='2.5.99-01012024' noheader=' update service dailytemp confsync -r -report ' diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 21a93fee..2c0f8d56 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -273,6 +273,7 @@ CHECKTEMP_SERVICE(){ SCAN_THREADS=4 echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - 'Check Temp' Service Startup" >> ${PW_LOGFILE} SENDTEMPS "TEMP Service Startup" & + [ -d ${PW_TMPFOLDER}/.lastinsert ] && mkdir ${PW_TMPFOLDER}/.lastinsert [ -d ${PW_TMPFOLDER}/.lasttemp ] && rm -Rf ${PW_TMPFOLDER}/.lasttemp mkdir ${PW_TMPFOLDER}/.lasttemp rm -f ${PW_TMPFOLDER}/ztemprun.* @@ -593,7 +594,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ fi fi - [ -f ${PW_TMPFOLDER}/${SENSOR}.insert ] && lastinsert=$(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}.insert)) || lastinsert=100000 + [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR} ] && lastinsert=$(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastinsert/${SENSOR})) || lastinsert=100000 if [ $(ls ${PW_TMPFOLDER}/temp.* 2>/dev/null | wc -l) -gt 0 ] || [ -f ${PW_TMPFOLDER}/power.ac.low ] || [ -f ${PW_TMPFOLDER}/power.dc.low ]; then wait=$(echo "scale=0; ${PW_MYSQL_LOG_INTERVAL_ABNORMAL}*60" | bc) else @@ -624,7 +625,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ # if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ]; then # ${mysql_conn} -e "USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID["${SENSORa}-Probe"]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_probe_f}')" # fi - touch ${PW_TMPFOLDER}/${SENSOR}.insert + touch ${PW_TMPFOLDER}/.lastinsert/${SENSOR} fi #### LOGGING OF SERVERROOM SENSOR DIFFERENCE