(change version)

By suggestion, now show no sensors output if error condition: missing sensors app OR no sensors output
This can be overridden for debugging by override with -! 1 flag, testing 1
This commit is contained in:
inxi-svn 2009-08-04 00:12:26 +00:00
parent 5c12898d86
commit 588dcac434

33
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.1.8 #### version: 1.1.9
#### Date: August 2 2009 #### Date: August 3 2009
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -4253,7 +4253,7 @@ print_sensors_data()
# always has at least 3 items, cpu/mobo/psu temp in it. If it's a single item, then # always has at least 3 items, cpu/mobo/psu temp in it. If it's a single item, then
# it's an error message, not the real data arrays. # it's an error message, not the real data arrays.
if [[ ${#a_sensors_working[@]} -eq 1 ]];then if [[ ${#a_sensors_working[@]} -eq 1 ]];then
cpu_temp=${A_SENSORS_DATA[0]} cpu_temp="${C1}Error:${C2} ${A_SENSORS_DATA[0]}"
b_is_error='true' b_is_error='true'
else else
for (( i=0; i < ${#A_SENSORS_DATA[@]}; i++ )) for (( i=0; i < ${#A_SENSORS_DATA[@]}; i++ ))
@ -4352,18 +4352,21 @@ print_sensors_data()
esac esac
done done
fi fi
temp_data="$cpu_temp$mobo_temp$psu_temp$gpu_temp" # turning off all output for case where no sensors detected or no sensors output
temp_data=$( create_print_line "Sensors:" "$temp_data" ) if [[ $b_is_error != 'true' || $B_TESTING_1 == 'true' ]];then
print_screen_output "$temp_data" temp_data="$cpu_temp$mobo_temp$psu_temp$gpu_temp"
# don't print second or subsequent lines if error data temp_data=$( create_print_line "Sensors:" "$temp_data" )
fan_data="$cpu_fan$mobo_fan$ps_fan$sys_fans" print_screen_output "$temp_data"
if [[ $b_is_error != 'true' && -n $fan_data ]];then # don't print second or subsequent lines if error data
fan_data=$( create_print_line " " "$fan_data" ) fan_data="$cpu_fan$mobo_fan$ps_fan$sys_fans"
print_screen_output "$fan_data" if [[ $b_is_error != 'true' && -n $fan_data ]];then
# and then second wrapped fan line if needed fan_data=$( create_print_line " " "$fan_data" )
if [[ -n $sys_fans2 ]];then print_screen_output "$fan_data"
fan_data2=$( create_print_line " " "$sys_fans2" ) # and then second wrapped fan line if needed
print_screen_output "$fan_data2" if [[ -n $sys_fans2 ]];then
fan_data2=$( create_print_line " " "$sys_fans2" )
print_screen_output "$fan_data2"
fi
fi fi
fi fi
eval $LOGFE eval $LOGFE