mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
added -P to df to avoid wrapping long lines. -P for posix, which means do not wrap long lines I guess.
This commit is contained in:
parent
85fbd5eb58
commit
fd9becb379
14
inxi
14
inxi
|
@ -3,7 +3,7 @@
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.7.15
|
#### version: 1.7.15
|
||||||
#### Date: July 6 2011
|
#### Date: July 6 2011
|
||||||
#### Patch Number: 00
|
#### Patch Number: 01
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -1398,9 +1398,9 @@ debug_data_collector()
|
||||||
ls -l /dev/disk/by-uuid &> $debug_data_dir/dev-disk-uuid-data.txt
|
ls -l /dev/disk/by-uuid &> $debug_data_dir/dev-disk-uuid-data.txt
|
||||||
ls -l /dev/disk/by-path &> $debug_data_dir/dev-disk-path-data.txt
|
ls -l /dev/disk/by-path &> $debug_data_dir/dev-disk-path-data.txt
|
||||||
readlink /dev/root &> $debug_data_dir/dev-root.txt
|
readlink /dev/root &> $debug_data_dir/dev-root.txt
|
||||||
df -h -T --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 --exclude-type=devfs --exclude-type=linprocfs --exclude-type=sysfs --exclude-type=fdescfs &> $debug_data_dir/df-h-T-excludes.txt
|
df -h -T -P --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 --exclude-type=devfs --exclude-type=linprocfs --exclude-type=sysfs --exclude-type=fdescfs &> $debug_data_dir/df-h-T-excludes.txt
|
||||||
swapon -s &> $debug_data_dir/swapon-s.txt
|
swapon -s &> $debug_data_dir/swapon-s.txt
|
||||||
df --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 &> $debug_data_dir/df-excludes.txt
|
df -P --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 &> $debug_data_dir/df-excludes.txt
|
||||||
cat $FILE_PARTITIONS &> $debug_data_dir/proc-partitions.txt
|
cat $FILE_PARTITIONS &> $debug_data_dir/proc-partitions.txt
|
||||||
cat $FILE_SCSI &> $debug_data_dir/proc-scsi.txt
|
cat $FILE_SCSI &> $debug_data_dir/proc-scsi.txt
|
||||||
cat $FILE_MOUNTS &> $debug_data_dir/proc-mounts.txt
|
cat $FILE_MOUNTS &> $debug_data_dir/proc-mounts.txt
|
||||||
|
@ -3957,7 +3957,7 @@ get_hdd_data_basic()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local hdd_used='' temp_array=''
|
local hdd_used='' temp_array=''
|
||||||
local hdd_data="$( df --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 )"
|
local hdd_data="$( df -P --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 )"
|
||||||
log_function_data 'raw' "hdd_data:\n$hdd_data"
|
log_function_data 'raw' "hdd_data:\n$hdd_data"
|
||||||
|
|
||||||
hdd_used=$( echo "$hdd_data" | gawk '
|
hdd_used=$( echo "$hdd_data" | gawk '
|
||||||
|
@ -3965,7 +3965,8 @@ get_hdd_data_basic()
|
||||||
/^\/dev\/(mapper\/|[hsv]d[a-z][0-9]+|dm[-]?[0-9]+)/ {
|
/^\/dev\/(mapper\/|[hsv]d[a-z][0-9]+|dm[-]?[0-9]+)/ {
|
||||||
# this handles the case where the first item is too long
|
# this handles the case where the first item is too long
|
||||||
# and makes df wrap output to next line, so here we advance
|
# and makes df wrap output to next line, so here we advance
|
||||||
# it to the next line for that single case
|
# 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 < 5 && $0 !~ /.*%/ ) {
|
if ( NF < 5 && $0 !~ /.*%/ ) {
|
||||||
getline
|
getline
|
||||||
}
|
}
|
||||||
|
@ -4904,7 +4905,7 @@ get_partition_data()
|
||||||
#local excluded_file_types='--exclude-type=aufs --exclude-type=tmpfs --exclude-type=iso9660'
|
#local excluded_file_types='--exclude-type=aufs --exclude-type=tmpfs --exclude-type=iso9660'
|
||||||
# df doesn't seem to work in script with variables like at the command line
|
# df doesn't seem to work in script with variables like at the command line
|
||||||
# added devfs linprocfs sysfs fdescfs which show on debian kfreebsd kernel output
|
# added devfs linprocfs sysfs fdescfs which show on debian kfreebsd kernel output
|
||||||
local main_partition_data="$( df -h -T --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 --exclude-type=devfs --exclude-type=linprocfs --exclude-type=sysfs --exclude-type=fdescfs )"
|
local main_partition_data="$( df -h -T -P --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 --exclude-type=devfs --exclude-type=linprocfs --exclude-type=sysfs --exclude-type=fdescfs )"
|
||||||
local swap_data="$( swapon -s )"
|
local swap_data="$( swapon -s )"
|
||||||
# set dev disk label/uuid data globals
|
# set dev disk label/uuid data globals
|
||||||
get_partition_uuid_label_data 'label'
|
get_partition_uuid_label_data 'label'
|
||||||
|
@ -4926,6 +4927,7 @@ get_partition_data()
|
||||||
# this is required because below we are subtracting from NF, so it has to be > 5
|
# this is required because below we are subtracting from NF, so it has to be > 5
|
||||||
# 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
|
||||||
# but we still need to handle more dynamically long space containing file names, but later.
|
# but we still need to handle more dynamically long space containing file names, but later.
|
||||||
|
# Using df -P should fix this, ie, no wrapping of line lines, but leaving this for now
|
||||||
( NF < 6 ) && ( $0 !~ /[0-9]+%/ ) {
|
( NF < 6 ) && ( $0 !~ /[0-9]+%/ ) {
|
||||||
# set the dev location here for cases of wrapped output
|
# set the dev location here for cases of wrapped output
|
||||||
if ( NF == 1 ){
|
if ( NF == 1 ){
|
||||||
|
|
Loading…
Reference in a new issue