diff --git a/inxi b/inxi index a173c22..e4616b8 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.8.2 -#### Date: May 11 2012 +#### version: 1.8.3 +#### Date: May 14 2012 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -282,6 +282,8 @@ B_SHOW_PARTITIONS_FULL='false' B_SHOW_PS_CPU_DATA='false' B_SHOW_PS_MEM_DATA='false' B_SHOW_RAID='false' +# because many systems have no mdstat file, -b/-F should not show error if no raid file found +B_SHOW_RAID_R='false' B_SHOW_REPOS='false' B_RUNNING_IN_X='false' B_SHOW_SENSORS='false' @@ -1926,6 +1928,10 @@ get_parameters() use_short='false' ;; R) B_SHOW_RAID='true' + # it turns out only users with mdraid software installed will have raid, + # so unless -R is explicitly called, blank -b/-F/-v6 and less output will not show + # error if file is missing. + B_SHOW_RAID_R='true' use_short='false' ;; s) B_SHOW_SENSORS='true' @@ -1993,6 +1999,7 @@ get_parameters() if [[ $OPTARG -ge 7 ]];then B_EXTRA_EXTRA_DATA='true' B_SHOW_IP='true' + B_SHOW_RAID_R='true' fi else error_handler 4 "$OPTARG" @@ -7795,7 +7802,7 @@ print_raid_data() local basic_raid='' basic_raid_separator='' basic_raid_plural='' inactive='' local component_separator='' device_id='' print_string='' loop_limit=0 array_count_unused='' local array_count='' raid_event='' b_print_lines='true' - + get_raid_data for (( i=0; i < ${#A_RAID_DATA[@]}; i++ )) @@ -7984,7 +7991,6 @@ print_raid_data() read_ahead=${a_partition_working[1]} read_ahead=" ${C1}read ahead${SEP3}${C2} $read_ahead" fi - elif [[ ${a_partition_working[0]} == 'UnusedDevices' ]];then if [[ ${a_partition_working[1]} == '' ]];then unused_devices='N/A' @@ -8005,15 +8011,15 @@ print_raid_data() fi if [[ $B_MDSTAT_FILE != 'true' ]];then - if [[ $B_SHOW_BASIC_RAID != 'true' ]];then - a_raid_data[0]="${C1}Error${SEP3}${C2} No $FILE_MDSTAT file detected!" + if [[ $B_SHOW_RAID_R == 'true' ]];then + a_raid_data[0]="No RAID data available - $FILE_MDSTAT is missing - is md_mod kernel module loaded?" else b_print_lines='false' fi else if [[ ${a_raid_data[0]} == '' ]];then if [[ $B_SHOW_BASIC_RAID != 'true' ]];then - a_raid_data[0]="${C1}Device${SEP3}${C2} No RAID devices detected!" + a_raid_data[0]="No RAID devices detected - /proc/mdstat and md_mod kernel raid module present" else b_print_lines='false' fi