Update temp.inc.sh

This commit is contained in:
2024-04-22 18:11:30 -05:00
parent 052418fa5f
commit 94a215b058

View File

@@ -1001,7 +1001,14 @@ Previous Temp: ${last_temp}${GAUGESH}"
if [ "${QRY}" != "" ]; then if [ "${QRY}" != "" ]; then
${mysql_conn} -e "${QRY}" ${mysql_conn} -e "${QRY}"
echo "${temp_f}" >| ${PW_TMPFOLDER}/.lastinsert/${SENSOR} echo "${temp_f}" >| ${PW_TMPFOLDER}/.lastinsert/${SENSOR}
if [[ "${SENSOR}" != *"CPU"* ]] && [[ "${SENSOR}" != *"FAN"* ]]; then
fi
# 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
fi
if [ "${temp_f}" != "" ] && [[ "${SENSOR}" != *"CPU"* ]] && [[ "${SENSOR}" != *"FAN"* ]]; then
if [ ! -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre ]; then if [ ! -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre ]; then
echo "${temp_f}" > ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre echo "${temp_f}" > ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre
@@ -1014,13 +1021,6 @@ Previous Temp: ${last_temp}${GAUGESH}"
rm -f {PW_TMPFOLDER}/.lastinsert/${SENSOR}.* rm -f {PW_TMPFOLDER}/.lastinsert/${SENSOR}.*
fi fi
fi
# 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
fi
#### LOGGING OF SERVERROOM SENSOR DIFFERENCE #### LOGGING OF SERVERROOM SENSOR DIFFERENCE
if [ "${SENSOR}" == "ServerRoom-Rear" ]; then if [ "${SENSOR}" == "ServerRoom-Rear" ]; 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