_lp_temp_acpi: handle multiple temperature sensors (multi CPU)

This commit is contained in:
Olivier Mengué 2013-12-05 00:13:57 +01:00
parent f634a94418
commit 47d093dbe6

View File

@ -1400,7 +1400,13 @@ _lp_temp_sensors()
_lp_temp_acpi()
{
expr "$(acpi -t)" : '.* \([0-9]*\)\.[0-9]* degrees C'
local temperature i
temperature=0
for i in $(acpi -t | sed 's/.* \([0-9]*\)\.[0-9]* degrees C$/\1/p')
do
(( $i > $temperature )) && temperature=$i
done
echo -ne "$temperature"
}
# Will set _LP_TEMP_FUNCTION so the temperature monitoring feature use an