Update temp.inc.sh

This commit is contained in:
2023-12-26 15:08:58 -06:00
parent fef4962fb4
commit b9e7ccc103

View File

@@ -333,6 +333,7 @@ CHECKTEMP_SERVICE(){
elif [[ "${1}" = *"FAN"* ]]; then
temp_c=$(cat /sys/class/hwmon/hwmon2/fan1_input)
temp_h=''
echo "EX: ${temp_c}"
fi
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "remotesystem" ]; then
@@ -365,6 +366,7 @@ CHECKTEMP_SERVICE(){
fi
[ "${last_temp[${SENSOR//-/}]}" == "" ] && last_temp[${SENSOR//-/}]=0
echo "EX: ${temp_c}"
logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR}
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
@@ -393,15 +395,12 @@ CHECKTEMP_SERVICE(){
if [ "${SENSOR}" == "ServerRoomTH" ]; then
temp_f=`echo "scale=2; ${temp_c}*1.8+32+${PW_ServerRoomTH_Dev}" | bc`
else
echo -en "H: ${SENSOR} : ${PW_SENSOR_TYPE[${SENSOR}]} - "
if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ]; then
echo 1
temp_f=$(echo "scale=2; $temp_c/1" | bc -l)
elif [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]]; then
echo "(${temp_c})-(${temp_f})"
temp_f=${temp_c}
else
echo 3
temp_f=$(bc <<< "scale=2; ${temp_c}*1.8+32")
fi
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"