diff --git a/inxi b/inxi index f1c2fc0..39c2917 100755 --- a/inxi +++ b/inxi @@ -3,7 +3,7 @@ #### Script Name: inxi #### Version: 1.9.8 #### Date: June 14 2013 -#### Patch Number: 05-b1 +#### Patch Number: 06-b1 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -4996,6 +4996,8 @@ get_hdd_data_basic() # is present. The value is searched for an earlier appearance of that partition and if it is # present, the data is not added into the partition used size. partitionsSet="" + # this handles a case where the same dev item is mounted twice to different points + devSet="" } # using $1, not $2, because older bsd df do not have -T, filesystem type ( bsdType != "" ) && $1 ~ /^(aufs|devfs|devtmpfs|fdescfs|iso9660|linprocfs|procfs|squashfs|sysfs|tmpfs|type|unionfs)$/ { @@ -5010,24 +5012,31 @@ get_hdd_data_basic() # it to the next line for that single case. Using df -P should # make this unneeded but leave it in just in case if ( NF < 6 && $0 !~ /.*%/ ) { + devSet = devSet "~" $1 "~" getline } # if the first item caused a wrap, use one less than standard # testing for the field with % in it, ie: 34%, then go down from there # this also protects against cases where the mount point has a space in the # file name, thus breaking going down from $NF directly. - if ( $5 ~ /.*%/ ) { + # some bsds will also have only 6 items + if ( $5 ~ /.*%/ && devSet !~ /.*~$1~.*/ ) { if ( partitionsSet !~ /.*~$6~.*/ ) { used += $3 } partitionsSet = partitionsSet "~" $6 "~" + # make sure to only include bsd real lines here, ie, short df output + if ( $1 ~ /\/dev\// ) { + devSet = devSet "~" $1 "~" + } } # otherwise use standard else if ( $6 ~ /.*%/ ) { - if ( partitionsSet !~ /.*~$7~.*/ ) { + if ( partitionsSet !~ /.*~$7~.*/ && devSet !~ /.*~$1~.*/ ) { used += $4 } partitionsSet = partitionsSet "~" $7 "~" + devSet = devSet "~" $1 "~" } # and if this is not detected, give up, we need user data to debug else {