Update temp.inc.sh
This commit is contained in:
@@ -308,7 +308,7 @@ CHECKTEMP(){
|
|||||||
[ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' '
|
[ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' '
|
||||||
if [ "${TTYPE}" == "fans" ]; then
|
if [ "${TTYPE}" == "fans" ]; then
|
||||||
tmp="${lmd}${spct}${temp_f}${GAUGESH}"
|
tmp="${lmd}${spct}${temp_f}${GAUGESH}"
|
||||||
c=0; spc=''; spc1=`expr ${fws} - ${#tmp} + 4`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
c=0; spc=''; spc1=`expr ${fws} - ${#tmp} + 5`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
||||||
echo -e "${spc}${idsCL[Default]}[ ${idsCL[Green]}${GL_LOW}°F${idsCL[Default]} <--> ${idsCL[LightYellow]}${GL_HIGH}°F${idsCL[Default]} ]"
|
echo -e "${spc}${idsCL[Default]}[ ${idsCL[Green]}${GL_LOW}°F${idsCL[Default]} <--> ${idsCL[LightYellow]}${GL_HIGH}°F${idsCL[Default]} ]"
|
||||||
else
|
else
|
||||||
tmp="${spct}${temp_f}${GAUGESH}"
|
tmp="${spct}${temp_f}${GAUGESH}"
|
||||||
@@ -970,6 +970,16 @@ 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 [ ! -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre ]; then
|
||||||
|
echo "${temp_f}" > ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre
|
||||||
|
|
||||||
|
elif ([ ! -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre)) -ge 900 ]) || ([ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old)) -ge 900 ]); then
|
||||||
|
mv ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old 2> /dev/null
|
||||||
|
echo "${temp_f}" > ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
# if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ]; then
|
# 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}')"
|
# ${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}')"
|
||||||
|
|||||||
Reference in New Issue
Block a user