mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
bug fix, new kernels/df show both / real filesystem and / and rootfs, creating double / entries.
This is fixed with a simple test to get rid of that possible outcome. We'll see if that's sufficient.
This commit is contained in:
parent
f63cf11e2c
commit
e7fd174440
11
inxi
11
inxi
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 1.7.28
|
||||
#### Date: January 7 2012
|
||||
#### version: 1.7.29
|
||||
#### Date: February 9 2012
|
||||
#### Patch Number: 00
|
||||
########################################################################
|
||||
#### SPECIAL THANKS
|
||||
|
@ -4945,6 +4945,13 @@ get_partition_data()
|
|||
|
||||
log_function_data 'raw' "main_partition_data:\n$main_partition_data\n\nswap_data:\n$swap_data"
|
||||
|
||||
# new kernels/df have rootfs and / repeated, creating two entries for the same partition
|
||||
# so check for two string endings of / then slice out the rootfs one, I could check for it
|
||||
# before slicing it out, but doing that would require the same action twice re code execution
|
||||
if [[ $( grep -cs '[[:space:]]/$' <<< "$main_partition_data" ) -gt 1 ]];then
|
||||
main_partition_data="$( grep -vs 'rootfs' <<< "$main_partition_data" )"
|
||||
fi
|
||||
log_function_data 'post-rootfs-filter' "main_partition_data:\n$main_partition_data\n\nswap_data:\n$swap_data"
|
||||
IFS=$'\n'
|
||||
# sample line: /dev/sda2 ext3 15G 8.9G 4.9G 65% /home
|
||||
# $NF = partition name; $(NF - 4) = partition size; $(NF - 3) = used, in gB; $(NF - 1) = percent used
|
||||
|
|
Loading…
Reference in a new issue