Update temp.inc.sh
This commit is contained in:
@@ -136,9 +136,9 @@ CHECKTEMPSENSOR(){
|
|||||||
|
|
||||||
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
|
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
|
||||||
if [ "${1}" == "ServerRoomTH" ]; then
|
if [ "${1}" == "ServerRoomTH" ]; then
|
||||||
temp_f=`echo "scale=1; ${temp_c}*1.8+32+${PW_ServerRoomTH_Dev}" | bc`
|
temp_f=`echo "scale=2; ${temp_c}*1.8+32+${PW_ServerRoomTH_Dev}" | bc`
|
||||||
else
|
else
|
||||||
[ "${PW_SENSOR_TYPE[${1}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(bc <<< "scale=1; ${temp_c}*1.8+32")
|
[ "${PW_SENSOR_TYPE[${1}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(bc <<< "scale=2; ${temp_c}*1.8+32")
|
||||||
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
|
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
|
||||||
fi
|
fi
|
||||||
# echo "HERE: '${temp_c}' -> '${temp_f}'"
|
# echo "HERE: '${temp_c}' -> '${temp_f}'"
|
||||||
@@ -173,7 +173,7 @@ CHECKTEMPSENSOR(){
|
|||||||
echo -e "${spc}[${spcw}${idsCL[Yellow]}${temp_warn}${GAUGESH}${idsCL[Default]} /${spcc}${idsCL[LightRed]}${temp_crit}${GAUGESH}=>${idsCL[Default]} ]"
|
echo -e "${spc}[${spcw}${idsCL[Yellow]}${temp_warn}${GAUGESH}${idsCL[Default]} /${spcc}${idsCL[LightRed]}${temp_crit}${GAUGESH}=>${idsCL[Default]} ]"
|
||||||
|
|
||||||
if [ "${1}" == "ServerRoomLA" ]; then
|
if [ "${1}" == "ServerRoomLA" ]; then
|
||||||
temp_probe_f=$(bc <<< "scale=1; ${temp_probe_c}*1.8+32")
|
temp_probe_f=$(bc <<< "scale=2; ${temp_probe_c}*1.8+32")
|
||||||
tmp="${spct}${temp_probe_f}"
|
tmp="${spct}${temp_probe_f}"
|
||||||
c=0; spc=''; spc1=`expr 10 - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
c=0; spc=''; spc1=`expr 10 - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
||||||
[ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' '
|
[ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' '
|
||||||
@@ -337,9 +337,9 @@ CHECKTEMP_SERVICE(){
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${SENSOR}" == "ServerRoomTH" ]; then
|
if [ "${SENSOR}" == "ServerRoomTH" ]; then
|
||||||
temp_f=`echo "scale=1; ${temp_c}*1.8+32+${PW_ServerRoomTH_Dev}" | bc`
|
temp_f=`echo "scale=2; ${temp_c}*1.8+32+${PW_ServerRoomTH_Dev}" | bc`
|
||||||
else
|
else
|
||||||
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(bc <<< "scale=1; ${temp_c}*1.8+32")
|
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(bc <<< "scale=2; ${temp_c}*1.8+32")
|
||||||
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
|
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -453,7 +453,7 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
|
|||||||
wait=$(echo "scale=0; ${PW_MYSQL_LOG_INTERVAL_NORMAL}*60" | bc)
|
wait=$(echo "scale=0; ${PW_MYSQL_LOG_INTERVAL_NORMAL}*60" | bc)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ] && temp_probe_f=$(bc <<< "scale=1; ${temp_probe_c}*1.8+32")
|
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ] && temp_probe_f=$(bc <<< "scale=2; ${temp_probe_c}*1.8+32")
|
||||||
|
|
||||||
if [ "${PW_SENSOR_ID[${SENSORa}]}" != "" ] && [ ${lastinsert} -ge ${wait} ]; then
|
if [ "${PW_SENSOR_ID[${SENSORa}]}" != "" ] && [ ${lastinsert} -ge ${wait} ]; then
|
||||||
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then
|
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user