Update temp.inc.sh
This commit is contained in:
@@ -478,6 +478,7 @@ CHECKTEMP(){
|
||||
for R in ${PW_TEMPIND_RANGE[@]}; do
|
||||
[ "${mysql_conn}" != "" ] && entityid=($(${mysql_conn} -e "SELECT id FROM servermonitor.entities WHERE BINARY name='${sensorname// /_}' AND sensorid='${PW_SENSOR_ID[${SENSOR}]}'"))
|
||||
[ "${mysql_conn}" != "" ] && OLD_temp_f=($(${mysql_conn} -e "SELECT temp FROM servermonitor.sensor_data WHERE sensorid='${PW_SENSOR_ID[${SENSOR}]}' AND entity=${entityid[1]} AND date >= DATE_SUB(NOW(), INTERVAL $(expr ${R} + 1) MINUTE) AND date <= DATE_SUB(NOW(), INTERVAL $(expr ${R} - 6) MINUTE) ORDER BY date ASC LIMIT 1"))
|
||||
echo "HERE: ${OLD_temp_f[0] - ${OLD_temp_f[1]}"
|
||||
if [ "${OLD_temp_f[1]}" != "" ]; then
|
||||
if [ $(bc -l <<< "${temp_f} < $(echo "scale=2; ${OLD_temp_f[0]}+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "$(echo "scale=2; ${OLD_temp_f[0]}-${PW_TEMPIND_DIFF}" | bc) < ${temp_f}") -eq 1 ]; then
|
||||
echo -en "${idsCL[White]}\u23F9 "
|
||||
|
||||
Reference in New Issue
Block a user