diff --git a/inxi b/inxi index 1a10ee7..3230c2c 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.1.3 -#### Date: 29 July 2009 +#### version: 1.1.4 +#### Date: 31 July 2009 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -3020,9 +3020,9 @@ get_sensors_data() IFS=$'\n' if [[ $B_SENSORS == 'true' ]];then # note: non-configured sensors gives error message, which we need to redirect to stdout - # also, -F ':' no space, since some cases have the data starting right after : + # also, -F ':' no space, since some cases have the data starting right after,like - :1287 A_SENSORS_DATA=( $( - sensors | gawk -F ': ' -v userCpuNo="$SENSORS_CPU_NO" ' + sensors | gawk -F ':' -v userCpuNo="$SENSORS_CPU_NO" ' BEGIN { IGNORECASE=1 core0Temp="" # only if all else fails... @@ -3120,7 +3120,7 @@ get_sensors_data() aFanMain[3]=gensub( /[ \t]*([0-9]+)[ \t]+(.*)/, "\\1", 1, $2 ) } - /^(FAN(1)? |CHASSIS(1)?)[ \t](.*)[ \t]*([0-9]+)[ \t]RPM/ { + /^(AUX|FAN(1)? |CHASSIS(1)? )(.*)[ \t]*([0-9]+)[ \t]RPM/ { aFanMain[4]=gensub( /[ \t]*([0-9]+)[ \t]+(.*)/, "\\1", 1, $2 ) } /^FAN([2-9]) |CHASSIS([2-9] )(.*)[ \t]*([0-9]+)[ \t]RPM/ { @@ -3150,7 +3150,16 @@ get_sensors_data() tempFanType=userCpuNo } else { - if ( temp1 >= temp2 ) { + # first some fringe cases with cooler cpu than mobo: assume which is cpu temp based on fan speed + # but only if other fan speed is 0 + if ( temp1 >= temp2 && 1 in aFanDefault && 2 in aFanDefault && aFanDefault[1] == 0 && aFanDefault[2] > 0 ) { + tempFanType=2 + } + else if ( temp2 >= temp1 && 1 in aFanDefault && 2 in aFanDefault && aFanDefault[2] == 0 && aFanDefault[1] > 0 ) { + tempFanType=1 + } + # then handle the standard case if these fringe cases are false + else if ( temp1 >= temp2 ) { tempFanType=1 } else { @@ -3230,6 +3239,18 @@ get_sensors_data() aFanDefault[j] = "" } } + + } + } + # now see if you can find the fast little mobo fan, > 5000 rpm and put it as mobo + for (j = 1; j <= indexCountaFanDefault; j++) { + if ( j in aFanDefault && aFanDefault[j] > 5000 && aFanMain[2] == "" ) { + aFanMain[2] = aFanDefault[j] + aFanDefault[j] = "" + # then add one if required for output + if ( indexCountaFanMain < 2 ) { + indexCountaFanMain = 2 + } } } @@ -4201,7 +4222,7 @@ print_sensors_data() ;; 2) if [[ -n ${a_sensors_working[2]} ]];then - ps_fan="${C1}ps:${C2} ${a_sensors_working[2]} " + ps_fan="${C1}psu:${C2} ${a_sensors_working[2]} " (( fan_count++ )) fi ;;