added Fahrenheit to thermal.

This commit is contained in:
2020-04-22 20:00:49 +00:00
parent f487f6e391
commit 300f51a599
+7 -4
View File
@@ -1,11 +1,14 @@
#!/bin/bash
name=$(</sys/class/thermal/thermal_zone0/type)
temp=$(</sys/class/thermal/thermal_zone0/temp)
temp="$((temp/1000)).$((temp/100%10))"
echo "${name}: ${temp} C"
mc=$(</sys/class/thermal/thermal_zone0/temp)
c=`echo "scale=1 ; $mc / 1000.0" | bc -l`
f=`echo "scale=1 ; $c * 9 / 5 + 32" | bc -l`
echo "${name}: ${c} C ($f F)"
if (( "$#" > "0" )); then
exit `echo "$temp >= $1" | bc`
exit `echo "$c >= $1" | bc`
fi