Update temp.inc.sh
This commit is contained in:
@@ -144,10 +144,14 @@ CHECKTEMP(){
|
|||||||
if [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 ]; then
|
if [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 ]; then
|
||||||
if [ $(bc -l <<< "${temp_f} <= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "${temp_f} >= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)-${PW_TEMPIND_DIFF}" | bc)") -eq 1 ]; then
|
if [ $(bc -l <<< "${temp_f} <= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "${temp_f} >= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)-${PW_TEMPIND_DIFF}" | bc)") -eq 1 ]; then
|
||||||
reading="${reading}${idsCL[White]}\u23F9 "
|
reading="${reading}${idsCL[White]}\u23F9 "
|
||||||
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then
|
elif [ $(bc -l <<< "$(bc <<< "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)+(${PW_TEMPIND_DIFF}*2)") < ${temp_f}") -eq 1 ]; then
|
||||||
reading="${reading}${idsCL[LightRed]}\u25B2 "
|
reading="${reading}${idsCL[LightRed]}\u25B2 "
|
||||||
elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)") -eq 1 ]; then
|
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then
|
||||||
|
reading="${reading}${idsCL[Magenta]}\u25B2 "
|
||||||
|
elif [ $(bc -l <<< "${temp_f} < $(bc <<< "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)-(${PW_TEMPIND_DIFF}*2)")") -eq 1 ]; then
|
||||||
reading="${reading}${idsCL[LightGreen]}\u25BC "
|
reading="${reading}${idsCL[LightGreen]}\u25BC "
|
||||||
|
elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 | cut -d'~' -f 1)") -eq 1 ]; then
|
||||||
|
reading="${reading}${idsCL[LightCyan]}\u25BC "
|
||||||
else
|
else
|
||||||
reading="${reading} "
|
reading="${reading} "
|
||||||
fi
|
fi
|
||||||
@@ -322,20 +326,28 @@ CHECKTEMP(){
|
|||||||
if [ "${temp_f}" != "" ] && [ "${average}" = "" ] && [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old ]; then
|
if [ "${temp_f}" != "" ] && [ "${average}" = "" ] && [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old ]; then
|
||||||
if [ $(bc -l <<< "${temp_f} <= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "${temp_f} >= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)-${PW_TEMPIND_DIFF}" | bc)") -eq 1 ]; then
|
if [ $(bc -l <<< "${temp_f} <= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "${temp_f} >= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)-${PW_TEMPIND_DIFF}" | bc)") -eq 1 ]; then
|
||||||
echo -en " ${idsCL[White]}\u23F9 "
|
echo -en " ${idsCL[White]}\u23F9 "
|
||||||
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then
|
elif [ $(bc -l <<< "$(bc <<< "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)+(${PW_TEMPIND_DIFF}*2)") < ${temp_f}") -eq 1 ]; then
|
||||||
echo -en " ${idsCL[LightRed]}\u25B2 "
|
echo -en " ${idsCL[LightRed]}\u25B2 "
|
||||||
elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)") -eq 1 ]; then
|
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then
|
||||||
|
echo -en " ${idsCL[Magenta]}\u25B2 "
|
||||||
|
elif [ $(bc -l <<< "$(bc <<< "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)-(${PW_TEMPIND_DIFF}*2)") < ${temp_f}") -eq 1 ]; then
|
||||||
echo -en " ${idsCL[LightGreen]}\u25BC "
|
echo -en " ${idsCL[LightGreen]}\u25BC "
|
||||||
|
elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)") -eq 1 ]; then
|
||||||
|
echo -en " ${idsCL[LightCyan]}\u25BC "
|
||||||
else
|
else
|
||||||
echo -en " "
|
echo -en " "
|
||||||
fi
|
fi
|
||||||
if [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 ]; then
|
if [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 ]; then
|
||||||
if [ $(bc -l <<< "${temp_f} <= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "${temp_f} >= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)-${PW_TEMPIND_DIFF}" | bc)") -eq 1 ]; then
|
if [ $(bc -l <<< "${temp_f} <= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "${temp_f} >= $(echo "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)-${PW_TEMPIND_DIFF}" | bc)") -eq 1 ]; then
|
||||||
echo -en "${idsCL[White]}\u23F9 "
|
echo -en "${idsCL[White]}\u23F9 "
|
||||||
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then
|
elif [ $(bc -l <<< "$(bc <<< "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)+(${PW_TEMPIND_DIFF}*2)") < ${temp_f}") -eq 1 ]; then
|
||||||
echo -en "${idsCL[LightRed]}\u25B2 "
|
echo -en "${idsCL[LightRed]}\u25B2 "
|
||||||
elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)") -eq 1 ]; then
|
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then
|
||||||
|
echo -en "${idsCL[Magenta]}\u25B2 "
|
||||||
|
elif [ $(bc -l <<< "$(bc <<< "scale=2; $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)-(${PW_TEMPIND_DIFF}*2)") < ${temp_f}") -eq 1 ]; then
|
||||||
echo -en "${idsCL[LightGreen]}\u25BC "
|
echo -en "${idsCL[LightGreen]}\u25BC "
|
||||||
|
elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old2 | cut -d'~' -f 1)") -eq 1 ]; then
|
||||||
|
echo -en "${idsCL[LightCyan]}\u25BC "
|
||||||
else
|
else
|
||||||
echo -en " "
|
echo -en " "
|
||||||
fi
|
fi
|
||||||
@@ -392,10 +404,14 @@ CHECKTEMP(){
|
|||||||
echo -e " Goldilock Zone : ${idsCL[LightGreen]}${ESXI_DEFAULT_EXHAUST_MIN}°F (±${ESXI_FANSPEED_GL_ZONE}°F)"
|
echo -e " Goldilock Zone : ${idsCL[LightGreen]}${ESXI_DEFAULT_EXHAUST_MIN}°F (±${ESXI_FANSPEED_GL_ZONE}°F)"
|
||||||
echo -e " Last checked : ${idsCL[LightCyan]}$(date -r ${PW_TMPFOLDER}/.lastfancheck/${SENSOR} "+%m/%d @ %l:%M%p")${idsCL[Default]}"
|
echo -e " Last checked : ${idsCL[LightCyan]}$(date -r ${PW_TMPFOLDER}/.lastfancheck/${SENSOR} "+%m/%d @ %l:%M%p")${idsCL[Default]}"
|
||||||
echo -en " Last set : ${FSC}$(date -r ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set "+%m/%d @ %l:%M%p") "
|
echo -en " Last set : ${FSC}$(date -r ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set "+%m/%d @ %l:%M%p") "
|
||||||
if [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "u" ]; then
|
if [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "uu" ]; then
|
||||||
echo -e "${idsCL[LightRed]}\u25B2 ${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}\u25B2 ${idsCL[Default]}"
|
||||||
|
elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "u" ]; then
|
||||||
|
echo -e "${idsCL[Magenta]}\u25B2 ${idsCL[Default]}"
|
||||||
|
elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "dd" ]; then
|
||||||
|
echo -e "${idsCL[LightGreen]}\u25BC ${idsCL[Default]}"
|
||||||
elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "d" ]; then
|
elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "d" ]; then
|
||||||
echo -e "\u25BC ${idsCL[Default]}"
|
echo -e "${idsCL[LightCyan]}\u25BC ${idsCL[Default]}"
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Default]}"
|
echo -e "${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
@@ -1136,9 +1152,17 @@ SET_ESXI_FANSPEED(){
|
|||||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${fan} - ${SET_HOST} - ${MSG}" >> ${PW_LOGFOLDER}/esxi-fanspeeds.log
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${fan} - ${SET_HOST} - ${MSG}" >> ${PW_LOGFOLDER}/esxi-fanspeeds.log
|
||||||
|
|
||||||
if [ $(bc -l <<< "${SET_FanSpeed} < $(cat ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set | cut -d'~' -f 1)") -eq 1 ]; then
|
if [ $(bc -l <<< "${SET_FanSpeed} < $(cat ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set | cut -d'~' -f 1)") -eq 1 ]; then
|
||||||
echo "${SET_FanSpeed}~d" >| ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set
|
if [ ${FAN_DECREASE} -eq 5 ]; then
|
||||||
|
echo "${SET_FanSpeed}~d" >| ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set
|
||||||
|
else
|
||||||
|
echo "${SET_FanSpeed}~dd" >| ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set
|
||||||
|
fi
|
||||||
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set | cut -d'~' -f 1) < ${SET_FanSpeed}") -eq 1 ]; then
|
elif [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set | cut -d'~' -f 1) < ${SET_FanSpeed}") -eq 1 ]; then
|
||||||
echo "${SET_FanSpeed}~u" >| ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set
|
if [ ${FAN_INCREASE} -eq 5 ]; then
|
||||||
|
echo "${SET_FanSpeed}~u" >| ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set
|
||||||
|
else
|
||||||
|
echo "${SET_FanSpeed}~uu" >| ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "${SET_FanSpeed}~e" >| ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set
|
echo "${SET_FanSpeed}~e" >| ${PW_TMPFOLDER}/.lastfancheck/${SET_HOST}.set
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user