Update temp.inc.sh
This commit is contained in:
@@ -120,11 +120,11 @@ CHECKTEMPSENSOR(){
|
|||||||
|
|
||||||
elif [ "${PW_SENSOR_TYPE[${1}]}" == "system" ]; then
|
elif [ "${PW_SENSOR_TYPE[${1}]}" == "system" ]; then
|
||||||
echo "H1: ${1}"
|
echo "H1: ${1}"
|
||||||
if [[ "${1}" = %"CPU"% ]]; then
|
if [[ "${1}" = *"CPU"* ]]; then
|
||||||
echo 1
|
echo 1
|
||||||
temp_c=$(vcgencmd measure_temp)
|
temp_c=$(vcgencmd measure_temp)
|
||||||
temp_c=${temp_c%\'*}; temp_c=${temp_c#*=}
|
temp_c=${temp_c%\'*}; temp_c=${temp_c#*=}
|
||||||
elif [[ "${1}" = %"FAN"% ]]; then
|
elif [[ "${1}" = *"FAN"* ]]; then
|
||||||
echo 2
|
echo 2
|
||||||
temp_c=$(cat /sys/class/hwmon/hwmon2/fan1_input)
|
temp_c=$(cat /sys/class/hwmon/hwmon2/fan1_input)
|
||||||
fi
|
fi
|
||||||
@@ -155,7 +155,7 @@ CHECKTEMPSENSOR(){
|
|||||||
else
|
else
|
||||||
if [ "${PW_SENSOR_TYPE[${1}]}" == "cpu" ]; then
|
if [ "${PW_SENSOR_TYPE[${1}]}" == "cpu" ]; then
|
||||||
temp_f=$(echo "scale=2; $temp_c/1" | bc -l)
|
temp_f=$(echo "scale=2; $temp_c/1" | bc -l)
|
||||||
elif [ "${PW_SENSOR_TYPE[${1}]}" == "system" ] && [[ "${1}" = %"FAN"% ]]; then
|
elif [ "${PW_SENSOR_TYPE[${1}]}" == "system" ] && [[ "${1}" = *"FAN"* ]]; then
|
||||||
temp_f=${temp_c}
|
temp_f=${temp_c}
|
||||||
else
|
else
|
||||||
temp_f=$(bc <<< "scale=2; ${temp_c}*1.8+32")
|
temp_f=$(bc <<< "scale=2; ${temp_c}*1.8+32")
|
||||||
|
|||||||
Reference in New Issue
Block a user