From bd85ec85c1c6486d690fc5256d0befeb27cf14a3 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 17 Dec 2023 11:56:50 -0600 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index c9b85b44..5079918c 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -136,9 +136,9 @@ CHECKTEMPSENSOR(){ if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; 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 - [ "${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}" fi # 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]} ]" 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}" c=0; spc=''; spc1=`expr 10 - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done [ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' ' @@ -337,9 +337,9 @@ CHECKTEMP_SERVICE(){ fi 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 - [ "${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}" fi @@ -453,7 +453,7 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}" wait=$(echo "scale=0; ${PW_MYSQL_LOG_INTERVAL_NORMAL}*60" | bc) 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_TYPE[${SENSORa}]}" == "esxi" ]; then