bug fixes, output fixes, error fixes

This commit is contained in:
inxi-svn 2009-07-27 05:53:29 +00:00
parent 0c198e1c74
commit c70c18e707

22
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 1.0.83-b1
#### version: 1.0.84-b1
#### Date: 26 July 2009
########################################################################
#### SPECIAL THANKS
@ -551,8 +551,6 @@ initialize_script_data()
if [[ -n $( which sensors ) ]];then
B_SENSORS='true'
else
A_SENSORS_DATA=( "Sensors tool requires missing app: lm-sensors" )
fi
if [[ -n $DISPLAY ]];then
@ -3013,8 +3011,8 @@ get_sensors_data()
{
eval $LOGFS
if [[ $B_SENSORS == 'true' ]];then
IFS=","
if [[ $B_SENSORS == 'true' ]];then
A_SENSORS_DATA=( $( sensors | gawk '
BEGIN {
IGNORECASE=1
@ -3042,17 +3040,22 @@ get_sensors_data()
}
END {
if ( moboTemp != "" && cpuTemp != "" && cpuFan != "" ) {
print moboTemp "," cpuTemp "," cpuFan
# if they are ALL null, print error message
if ( moboTemp == "" && cpuTemp == "" && cpuFan == "" ) {
print "No active sensors found. Have you configured your sensors yet?"
}
else {
print "No sensors found. Have you configured your sensors yet?"
print moboTemp "," cpuTemp "," cpuFan
}
}
'
) )
IFS="$ORIGINAL_IFS"
# the error case needs to go here because we are setting special array delimiter ','
else
A_SENSORS_DATA=( "You do not have the sensors app installed." )
fi
IFS="$ORIGINAL_IFS"
log_function_data "A_SENSORS_DATA: ${A_SENSORS_DATA[@]}"
echo "A_SENSORS_DATA: ${A_SENSORS_DATA[@]}"
eval $LOGFE
@ -3915,8 +3918,9 @@ print_sensors_data()
local mobo_temp='' cpu_temp='' cpu_fan='' sensors_data=''
get_sensors_data
# initial error cases, for missing app or unconfigured sensors
if [[ ${#A_SENSORS_DATA[@]} -eq 1 ]];then
sensors_data=${A_SENSORS_DATA[0]}
mobo_temp=${A_SENSORS_DATA[0]}
else
if [[ -n ${A_SENSORS_DATA[0]} ]];then
mobo_temp=${A_SENSORS_DATA[0]}