Update temp.inc.sh
This commit is contained in:
@@ -218,6 +218,7 @@ CHECKTEMP(){
|
|||||||
for M in 15 30 60 120; do
|
for M in 15 30 60 120; do
|
||||||
lico=" "
|
lico=" "
|
||||||
OLD_temp_f=($(${mysql_conn} -e "SELECT temp FROM servermonitor.sensor_data WHERE sensorid='${PW_SENSOR_ID[${SENSOR}]}' AND date >= DATE_SUB(NOW(), INTERVAL ${M} MINUTE) AND date <= DATE_SUB(NOW(), INTERVAL $(expr ${M} - 7) MINUTE) ORDER BY date ASC LIMIT 1"))
|
OLD_temp_f=($(${mysql_conn} -e "SELECT temp FROM servermonitor.sensor_data WHERE sensorid='${PW_SENSOR_ID[${SENSOR}]}' AND date >= DATE_SUB(NOW(), INTERVAL ${M} MINUTE) AND date <= DATE_SUB(NOW(), INTERVAL $(expr ${M} - 7) MINUTE) ORDER BY date ASC LIMIT 1"))
|
||||||
|
if [ "${OLD_temp_f[1]}" != "" ]; then
|
||||||
if [ $(bc -l <<< "${temp_f} < $(echo "scale=2; ${OLD_temp_f[1]}+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "$(echo "scale=2; ${OLD_temp_f[1]}-${PW_TEMPIND_DIFF}" | bc) < ${temp_f}") -eq 1 ]; then
|
if [ $(bc -l <<< "${temp_f} < $(echo "scale=2; ${OLD_temp_f[1]}+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "$(echo "scale=2; ${OLD_temp_f[1]}-${PW_TEMPIND_DIFF}" | bc) < ${temp_f}") -eq 1 ]; then
|
||||||
lclr="${idsCL[White]}"
|
lclr="${idsCL[White]}"
|
||||||
elif [ $(bc -l <<< "$(bc <<< "scale=2; ${OLD_temp_f[1]}+(${PW_TEMPIND_DIFF}*2)") < ${temp_f}") -eq 1 ]; then
|
elif [ $(bc -l <<< "$(bc <<< "scale=2; ${OLD_temp_f[1]}+(${PW_TEMPIND_DIFF}*2)") < ${temp_f}") -eq 1 ]; then
|
||||||
@@ -235,6 +236,10 @@ CHECKTEMP(){
|
|||||||
else
|
else
|
||||||
lclr="${idsCL[Default]}"
|
lclr="${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
lclr="${idsCL[Default]}"
|
||||||
|
lico="\u22C5"
|
||||||
|
fi
|
||||||
([ "${temp_h}" != "" ] && [ "${temp_h}" != "0" ]) && echo -en "${idsCL[White]}| " || echo -n " "
|
([ "${temp_h}" != "" ] && [ "${temp_h}" != "0" ]) && echo -en "${idsCL[White]}| " || echo -n " "
|
||||||
[ ${#M} -eq 2 ] && echo -n " "
|
[ ${#M} -eq 2 ] && echo -n " "
|
||||||
echo -e "${idsCL[White]} ${lclr}${M} Mins Ago ${lico} ${OLD_temp_f[1]}${GAUGESH}"
|
echo -e "${idsCL[White]} ${lclr}${M} Mins Ago ${lico} ${OLD_temp_f[1]}${GAUGESH}"
|
||||||
|
|||||||
Reference in New Issue
Block a user