mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
bug fixes, output fixes, error fixes
This commit is contained in:
parent
0c198e1c74
commit
c70c18e707
22
inxi
22
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.0.83-b1
|
#### version: 1.0.84-b1
|
||||||
#### Date: 26 July 2009
|
#### Date: 26 July 2009
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
|
@ -551,8 +551,6 @@ initialize_script_data()
|
||||||
|
|
||||||
if [[ -n $( which sensors ) ]];then
|
if [[ -n $( which sensors ) ]];then
|
||||||
B_SENSORS='true'
|
B_SENSORS='true'
|
||||||
else
|
|
||||||
A_SENSORS_DATA=( "Sensors tool requires missing app: lm-sensors" )
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $DISPLAY ]];then
|
if [[ -n $DISPLAY ]];then
|
||||||
|
@ -3013,8 +3011,8 @@ get_sensors_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
|
|
||||||
if [[ $B_SENSORS == 'true' ]];then
|
|
||||||
IFS=","
|
IFS=","
|
||||||
|
if [[ $B_SENSORS == 'true' ]];then
|
||||||
A_SENSORS_DATA=( $( sensors | gawk '
|
A_SENSORS_DATA=( $( sensors | gawk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
|
@ -3042,17 +3040,22 @@ get_sensors_data()
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
if ( moboTemp != "" && cpuTemp != "" && cpuFan != "" ) {
|
# if they are ALL null, print error message
|
||||||
print moboTemp "," cpuTemp "," cpuFan
|
if ( moboTemp == "" && cpuTemp == "" && cpuFan == "" ) {
|
||||||
|
print "No active sensors found. Have you configured your sensors yet?"
|
||||||
}
|
}
|
||||||
else {
|
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
|
fi
|
||||||
|
|
||||||
|
IFS="$ORIGINAL_IFS"
|
||||||
log_function_data "A_SENSORS_DATA: ${A_SENSORS_DATA[@]}"
|
log_function_data "A_SENSORS_DATA: ${A_SENSORS_DATA[@]}"
|
||||||
echo "A_SENSORS_DATA: ${A_SENSORS_DATA[@]}"
|
echo "A_SENSORS_DATA: ${A_SENSORS_DATA[@]}"
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -3915,8 +3918,9 @@ print_sensors_data()
|
||||||
local mobo_temp='' cpu_temp='' cpu_fan='' sensors_data=''
|
local mobo_temp='' cpu_temp='' cpu_fan='' sensors_data=''
|
||||||
get_sensors_data
|
get_sensors_data
|
||||||
|
|
||||||
|
# initial error cases, for missing app or unconfigured sensors
|
||||||
if [[ ${#A_SENSORS_DATA[@]} -eq 1 ]];then
|
if [[ ${#A_SENSORS_DATA[@]} -eq 1 ]];then
|
||||||
sensors_data=${A_SENSORS_DATA[0]}
|
mobo_temp=${A_SENSORS_DATA[0]}
|
||||||
else
|
else
|
||||||
if [[ -n ${A_SENSORS_DATA[0]} ]];then
|
if [[ -n ${A_SENSORS_DATA[0]} ]];then
|
||||||
mobo_temp=${A_SENSORS_DATA[0]}
|
mobo_temp=${A_SENSORS_DATA[0]}
|
||||||
|
|
Loading…
Reference in a new issue