mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
(no version change, but update)
Added wrapped mount point output
This commit is contained in:
parent
18c22cbadf
commit
9a4e3433c5
14
inxi
14
inxi
|
@ -2374,17 +2374,23 @@ get_partition_data()
|
||||||
A_PARTITION_DATA=( $( df -h -T --exclude-type=aufs --exclude-type=tmpfs --exclude-type=iso9660 | gawk '
|
A_PARTITION_DATA=( $( df -h -T --exclude-type=aufs --exclude-type=tmpfs --exclude-type=iso9660 | gawk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
|
mountPoint=""
|
||||||
}
|
}
|
||||||
|
mountPoint=""
|
||||||
# this is required because below we are subtracting from NF, so it has to be
|
# this is required because below we are subtracting from NF, so it has to be
|
||||||
# > 1, actually greater than 4, but that is so unlikely to occur because
|
# > 1, actually greater than 4, but that is so unlikely to occur because
|
||||||
# the real issue is long file system names that force the wrap of df output: //fileserver/main
|
# the real issue is long file system names that force the wrap of df output: //fileserver/main
|
||||||
( NF < 5 ) && ( $0 !~ /[0-9]+\%/ ) {
|
( NF < 5 ) && ( $0 !~ /[0-9]+\%/ ) {
|
||||||
|
# set the mount point here for cases of wrapped output
|
||||||
|
if ( NF == 1 ){
|
||||||
|
mountPoint=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, $1 )
|
||||||
|
}
|
||||||
getline
|
getline
|
||||||
}
|
}
|
||||||
# this handles yet another fredforfaen special case where a mounted drive
|
# this handles yet another fredforfaen special case where a mounted drive
|
||||||
# has the search string in its name
|
# has the search string in its name
|
||||||
$NF ~ /^\/$|^\/boot$|^\/var$|^\/home$|^\/tmp$|^\/usr$/ {
|
$NF ~ /^\/$|^\/boot$|^\/var$|^\/home$|^\/tmp$|^\/usr$/ {
|
||||||
print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",main"
|
print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",main," mountPoint
|
||||||
}
|
}
|
||||||
# skip all these, including the first, header line. Use the --exclude-type
|
# skip all these, including the first, header line. Use the --exclude-type
|
||||||
# to handle new filesystems types we do not want listed here
|
# to handle new filesystems types we do not want listed here
|
||||||
|
@ -2393,14 +2399,14 @@ get_partition_data()
|
||||||
# the test show the wrong data in each of the fields, if no x%, then do not use
|
# the test show the wrong data in each of the fields, if no x%, then do not use
|
||||||
# using 3 cases, first default, standard, 2nd, 3rd, handles one and two spaces in name
|
# using 3 cases, first default, standard, 2nd, 3rd, handles one and two spaces in name
|
||||||
if ( $(NF - 1) ~ /[0-9]+\%/ ) {
|
if ( $(NF - 1) ~ /[0-9]+\%/ ) {
|
||||||
print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",secondary"
|
print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",secondary," mountPoint
|
||||||
}
|
}
|
||||||
# these two cases construct the space containing name
|
# these two cases construct the space containing name
|
||||||
else if ( $(NF - 2) ~ /[0-9]+\%/ ) {
|
else if ( $(NF - 2) ~ /[0-9]+\%/ ) {
|
||||||
print $(NF - 1) " " $NF "," $(NF - 5) "," $(NF - 4) "," $(NF - 2) ",secondary"
|
print $(NF - 1) " " $NF "," $(NF - 5) "," $(NF - 4) "," $(NF - 2) ",secondary," mountPoint
|
||||||
}
|
}
|
||||||
else if ( $(NF - 3) ~ /[0-9]+\%/ ) {
|
else if ( $(NF - 3) ~ /[0-9]+\%/ ) {
|
||||||
print $(NF - 2) " " $(NF - 1) " " $NF "," $(NF - 6) "," $(NF - 5) "," $(NF - 3) ",secondary"
|
print $(NF - 2) " " $(NF - 1) " " $NF "," $(NF - 6) "," $(NF - 5) "," $(NF - 3) ",secondary," mountPoint
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
' )
|
' )
|
||||||
|
|
Loading…
Reference in a new issue