mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
trying to handle fan1:, temp1:, temp2:
This commit is contained in:
parent
73a25f53cc
commit
7a6e1bdec3
45
inxi
45
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.0.85-b1
|
#### version: 1.0.86-b1
|
||||||
#### Date: 26 July 2009
|
#### Date: 26 July 2009
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
|
@ -3019,26 +3019,51 @@ get_sensors_data()
|
||||||
moboTemp=""
|
moboTemp=""
|
||||||
cpuTemp=""
|
cpuTemp=""
|
||||||
cpuFan=""
|
cpuFan=""
|
||||||
|
tempData1=""
|
||||||
|
tempData2=""
|
||||||
}
|
}
|
||||||
# dumping the extra + signs, nobody has negative temps
|
# dumping the extra + signs, nobody has negative temps
|
||||||
# also, note gawk treats ° as a space, so we have to get the C/F data
|
# also, note gawk treats ° as a space, so we have to get the C/F data
|
||||||
# explicitly by testing for $4 ~ /C|F/ then concatenating manually
|
# explicitly by testing for $4 ~ /C|F/ then concatenating manually
|
||||||
# there are some guesses here, and we will need a lot more data of
|
# there are some guesses here, and we will need a lot more data of
|
||||||
# different systems before this can be trusted much
|
# different systems before this can be trusted much. Note that there
|
||||||
|
# is a hack here to handle cases where search term has 1 or 2 words with space
|
||||||
/M\/B Temp|SYS Temp|temp2:/ {
|
/M\/B Temp|SYS Temp|temp2:/ {
|
||||||
moboTemp=gensub( /\+(.+)/, "\\1", 1, $3 )
|
if ( $1 == "temp2:" ) {
|
||||||
if ( $4 ~ /C|F/ ){
|
tempData1=$2
|
||||||
moboTemp=moboTemp "°" $4
|
tempData2=$3
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tempData1=$3
|
||||||
|
tempData2=$4
|
||||||
|
}
|
||||||
|
moboTemp=gensub( /\+(.+)/, "\\1", 1, tempData1 )
|
||||||
|
if ( tempData2 ~ /C|F/ ){
|
||||||
|
moboTemp=moboTemp "°" tempData2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/CPU Temp|temp1:/ {
|
/CPU Temp|temp1:/ {
|
||||||
cpuTemp=gensub( /\+(.+)/, "\\1", 1, $3 )
|
if ( $1 == "temp1:" ) {
|
||||||
if ( $4 ~ /C|F/ ){
|
tempData1=$2
|
||||||
cpuTemp=cpuTemp "°" $4
|
tempData2=$3
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tempData1=$3
|
||||||
|
tempData2=$4
|
||||||
|
}
|
||||||
|
cpuTemp=gensub( /\+(.+)/, "\\1", 1, tempData1 )
|
||||||
|
if ( tempData2 ~ /C|F/ ){
|
||||||
|
cpuTemp=cpuTemp "°" tempData2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/CPU Fan/ {
|
/CPU Fan|fan1:/ {
|
||||||
cpuFan=$3
|
if ( $1 == "fan1:" ) {
|
||||||
|
tempData1=$2
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tempData1=$3
|
||||||
|
}
|
||||||
|
cpuFan=tempData1
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
|
|
Loading…
Reference in a new issue