Revert "Bugfix when temperature is not present or readings are invalid"

This reverts commit 7f2337ed53.
This commit is contained in:
Igor Pecovnik 2017-12-15 10:44:59 +01:00
parent 751aa7194f
commit d93ad66f39

View File

@ -344,23 +344,18 @@ MonitorMode() {
;;
esac
if [ "X${SocTemp}" != "Xn/a" ]; then
read SocTemp <"${Sensors}/soctemp" 2>/dev/null
if [ ! -z $(echo "$SocTemp" | grep -o "^[1-9][0-9]*\.\?[0-9]*$") ] && (( $(echo "${SocTemp} > 1000" |bc -l) )); then
read SocTemp <"${Sensors}/soctemp"
if [ ${SocTemp} -ge 1000 ]; then
SocTemp=$(awk '{printf ("%0.1f",$1/1000); }' <<<${SocTemp})
echo -e " $(printf "%4s" ${SocTemp})°C\c"
else
echo -e " n/a\c"
fi
echo -e " $(printf "%4s" ${SocTemp})°C\c"
fi
if [ "X${PMICTemp}" != "Xn/a" ]; then
read PMICTemp <"${Sensors}/pmictemp" 2>/dev/null
if [ ! -z $(echo "$PMICTemp" | grep -o "^[1-9][0-9]*\.\?[0-9]*$") ] && (( $(echo "${PMICTemp} > 1000" |bc -l) )); then
read PMICTemp <"${Sensors}/pmictemp"
if [ ${PMICTemp} -ge 1000 ]; then
PMICTemp=$(awk '{printf ("%0.1f",$1/1000); }' <<<${PMICTemp})
echo -e " $(printf "%4s" ${PMICTemp})°C\c"
else
echo -e " n/a\c"
fi
echo -e " $(printf "%4s" ${PMICTemp})°C\c"
fi
[ "X${DCIN}" != "Xn/a" ] && \
(DCINvoltage=$(awk '{printf ("%0.2f",$1/1000000); }' <"${DCIN}") ; echo -e " $(printf "%5s" ${DCINvoltage})V\c")