mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
fixed for older systems, -M with dmidecode can be empty, so error messages should also show that.
This commit is contained in:
parent
e64687d88f
commit
ef8f431ec4
11
inxi
11
inxi
|
@ -4316,8 +4316,12 @@ get_machine_data()
|
|||
separator=','
|
||||
done
|
||||
else
|
||||
if [[ -n $( type -p dmidecode 2>/dev/null ) ]];then
|
||||
if [[ -n $( type -p dmidecode 2>/dev/null ) && -n $( dmidecode 2>/dev/null ) ]];then
|
||||
if [[ $B_ROOT == 'true' ]];then
|
||||
# this handles very old systems, like Lenny 2.6.26, with dmidecode, but no data
|
||||
if [[ -z $( dmidecode 2>/dev/null | grep -i 'no smbios or dmi' ) ]];then
|
||||
array_string='dmidecode-no-smbios-dmi-data'
|
||||
else
|
||||
for dmi_name in $dmi_names
|
||||
do
|
||||
# echo "$dmi_name" >&2
|
||||
|
@ -4344,6 +4348,7 @@ get_machine_data()
|
|||
array_string="$array_string$separator$dmi_data"
|
||||
separator=','
|
||||
done
|
||||
fi
|
||||
else
|
||||
array_string='dmidecode-non-root-user'
|
||||
fi
|
||||
|
@ -6935,8 +6940,12 @@ print_machine_data()
|
|||
system_line="${C2}No /sys machine data. Try newer kernel, or install dmidecode.${CN}"
|
||||
fi
|
||||
# patch to dump all of above if dmidecode was data source and non root user
|
||||
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' || ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
|
||||
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' ]];then
|
||||
system_line="${C2}You must be root to use dmidecode. Fallback mode from non-present /sys data.${CN}"
|
||||
elif [[ ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
|
||||
system_line="${C2}No dmidecode data available for system. Fallback mode from non-present /sys data.${CN}"
|
||||
fi
|
||||
mobo_line=''
|
||||
bios_line=''
|
||||
chassis_line=''
|
||||
|
|
Loading…
Reference in a new issue