fine tuned sys fan speeds

This commit is contained in:
inxi-svn 2009-07-27 21:32:18 +00:00
parent a4dde53b0f
commit d1b260fff6

45
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.0.91-b1 #### version: 1.0.92-b1
#### Date: 26 July 2009 #### Date: 27 July 2009
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -3025,6 +3025,7 @@ get_sensors_data()
temp1="" temp1=""
temp2="" temp2=""
cpuFan="" cpuFan=""
psFan=""
sysFan1="" sysFan1=""
sysFan2="" sysFan2=""
sysFan3="" sysFan3=""
@ -3069,15 +3070,45 @@ get_sensors_data()
cpuFan=$3 cpuFan=$3
} }
} }
/^fan1:/ { /^fan1:|FAN1 Speed:/ {
if ( $1 == "fan1:" ){
sysFan1=$2 sysFan1=$2
} }
/^fan2:/ { else if ( $2 == "Speed:" ) {
sysFan1=$3
}
else if ( $3 == "Speed:" ) {
sysFan1=$4
}
}
/^fan2:|FAN2 Speed:/ {
if ( $1 == "fan2:" ){
sysFan2=$2 sysFan2=$2
} }
/^fan3:/ { else if ( $2 == "Speed:" ) {
sysFan2=$3
}
else if ( $3 == "Speed:" ) {
sysFan2=$4
}
}
/^fan3:|FAN3 Speed:/ {
if ( $1 == "fan3:" ){
sysFan3=$2 sysFan3=$2
} }
else if ( $2 == "Speed:" ) {
sysFan3=$3
}
else if ( $3 == "Speed:" ) {
sysFan3=$4
}
}
/Power_FAN Speed:/ {
psFan=$3
}
/POWER FAN Speed:/ {
psFan=$4
}
END { END {
# first we need to handle the case where we have to determine which temp/fan to use for cpu and mobo: # first we need to handle the case where we have to determine which temp/fan to use for cpu and mobo:
@ -3150,12 +3181,12 @@ get_sensors_data()
cpuTempReal = cpuTempReal tempUnit cpuTempReal = cpuTempReal tempUnit
} }
# if they are ALL null, print error message # if they are ALL null, print error message. psFan is not used in output currently
if ( moboTempReal == "" && cpuTempReal == "" && cpuFanReal == "" && sysFan1Real == "" && sysFan2Real == "" && sysFan3Real == "" ) { if ( moboTempReal == "" && cpuTempReal == "" && cpuFanReal == "" && sysFan1Real == "" && sysFan2Real == "" && sysFan3Real == "" ) {
print "No active sensors found. Have you configured your sensors yet?" print "No active sensors found. Have you configured your sensors yet?"
} }
else { else {
print moboTempReal "," cpuTempReal "," cpuFanReal "," sysFan1 "," sysFan2 "," sysFan3 print moboTempReal "," cpuTempReal "," cpuFanReal "," sysFan1 "," sysFan2 "," sysFan3 "," psFan
} }
} }
' '