mirror of
https://github.com/smxi/inxi.git
synced 2025-02-23 21:42:18 +00:00
bug fix should be ready to go now
This commit is contained in:
parent
fcf71c9f55
commit
a9fe030cea
29
inxi
29
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 1.1.1-b1
|
||||
#### version: 1.1.2-b1
|
||||
#### Date: 29 July 2009
|
||||
########################################################################
|
||||
#### SPECIAL THANKS
|
||||
|
@ -3011,7 +3011,10 @@ get_partition_data_advanced()
|
|||
get_sensors_data()
|
||||
{
|
||||
eval $LOGFS
|
||||
sample="
|
||||
|
||||
"
|
||||
# echo "$sample" | gawk -F ': ' -v userCpuNo="$SENSORS_CPU_NO" '
|
||||
IFS=$'\n'
|
||||
if [[ $B_SENSORS == 'true' ]];then
|
||||
# note: non-configured sensors gives error message, which we need to redirect to stdout
|
||||
|
@ -3202,17 +3205,6 @@ get_sensors_data()
|
|||
}
|
||||
}
|
||||
|
||||
# then set mobo fan if missing. Note, not trying to guess on either of these
|
||||
# if ( ! 2 in aFanMain ) {
|
||||
# aFanMain[2] = ""
|
||||
# }
|
||||
# # then set psu fan if missing
|
||||
# if ( ! 3 in aFanMain ) {
|
||||
# aFanMain[3] = ""
|
||||
# }
|
||||
|
||||
|
||||
|
||||
# then we need to get the actual numeric max array count for both fan arrays
|
||||
for (i = 0; i <= 14; i++) {
|
||||
if ( i in aFanMain && i > indexCountaFanMain ) {
|
||||
|
@ -3263,6 +3255,10 @@ get_sensors_data()
|
|||
else {
|
||||
# then build array arrays:
|
||||
print cpuTempReal "," moboTempReal "," psuTemp
|
||||
# this is for output, a null print line does NOT create a new array index in bash
|
||||
if ( fanMainString == "" && fanDefaultString == "" ) {
|
||||
fanMainString=","
|
||||
}
|
||||
print fanMainString
|
||||
print fanDefaultString
|
||||
}
|
||||
|
@ -4139,8 +4135,11 @@ print_sensors_data()
|
|||
local a_sensors_working=''
|
||||
get_sensors_data
|
||||
|
||||
IFS=","
|
||||
a_sensors_working=( ${A_SENSORS_DATA[0]} )
|
||||
IFS="$ORIGINAL_IFS"
|
||||
# initial error cases, for missing app or unconfigured sensors
|
||||
if [[ ${#A_SENSORS_DATA[@]} -eq 1 ]];then
|
||||
if [[ ${#a_sensors_working[@]} -eq 1 ]];then
|
||||
cpu_temp=${A_SENSORS_DATA[0]}
|
||||
b_is_error='true'
|
||||
else
|
||||
|
@ -4240,8 +4239,8 @@ print_sensors_data()
|
|||
temp_data=$( create_print_line "Sensors:" "$temp_data" )
|
||||
print_screen_output "$temp_data"
|
||||
# don't print second or subsequent lines if error data
|
||||
if [[ $b_is_error != 'true' ]];then
|
||||
fan_data="$cpu_fan$mobo_fan$ps_fan$sys_fans"
|
||||
fan_data="$cpu_fan$mobo_fan$ps_fan$sys_fans"
|
||||
if [[ $b_is_error != 'true' && -n $fan_data ]];then
|
||||
fan_data=$( create_print_line " " "$fan_data" )
|
||||
print_screen_output "$fan_data"
|
||||
# and then second wrapped fan line if needed
|
||||
|
|
Loading…
Reference in a new issue