Change the way that temperature is retrieved
Fixes issue with temperatures < 10.
This commit is contained in:
parent
2286e23d19
commit
8e88c82517
@ -194,8 +194,9 @@ if [[ -z "$sensor" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#Get the temperature
|
# Get the temperature
|
||||||
TEMP=`${SENSORPROG} | grep "$sensor" | cut -d+ -f2 | cut -c1-2 | head -n1`
|
# Grep the first float with a plus sign and keep only the integer
|
||||||
|
TEMP=`${SENSORPROG} | grep "$sensor" | head -n1 | grep -o "+[0-9]\+\(.[0-9]\+\)\?" | head -n1 | tr -d '+' | cut -d. -f1`
|
||||||
#Old way - Get the temperature
|
#Old way - Get the temperature
|
||||||
#TEMP=`${SENSORPROG} | grep "$sensor" | awk '{print $3}' | cut -c2-3 | head -n1`
|
#TEMP=`${SENSORPROG} | grep "$sensor" | awk '{print $3}' | cut -c2-3 | head -n1`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user