mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
New version, updated man page. A bug fix for an old time bug: with mdraid, -o (unmounted
partitions) would show components of the md raid array as unmounted partitions. This is of course incorrect, and is now fixed. Small update of man page as well to note that -o will not show components of mdraid arrays.
This commit is contained in:
parent
20ca07336e
commit
43fd70ca90
35
inxi
35
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### Version: 1.8.40
|
#### Version: 1.8.41
|
||||||
#### Date: February 27 2013
|
#### Date: February 27 2013
|
||||||
#### Patch Number: 00
|
#### Patch Number: 00
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -270,6 +270,7 @@ B_PCICONF='false'
|
||||||
# kde qdbus
|
# kde qdbus
|
||||||
B_QDBUS='false'
|
B_QDBUS='false'
|
||||||
B_PORTABLE='false'
|
B_PORTABLE='false'
|
||||||
|
B_RAID_SET='false'
|
||||||
B_ROOT='false'
|
B_ROOT='false'
|
||||||
B_RUN_COLOR_SELECTOR='false'
|
B_RUN_COLOR_SELECTOR='false'
|
||||||
# Running in a shell? Defaults to false, and is determined later.
|
# Running in a shell? Defaults to false, and is determined later.
|
||||||
|
@ -6769,7 +6770,7 @@ get_raid_data()
|
||||||
get_raid_data_bsd
|
get_raid_data_bsd
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
B_RAID_SET='true'
|
||||||
temp_array=${A_RAID_DATA[@]}
|
temp_array=${A_RAID_DATA[@]}
|
||||||
log_function_data "A_RAID_DATA: $temp_array"
|
log_function_data "A_RAID_DATA: $temp_array"
|
||||||
# echo -e "A_RAID_DATA:\n${temp_array}"
|
# echo -e "A_RAID_DATA:\n${temp_array}"
|
||||||
|
@ -7534,14 +7535,19 @@ get_tty_number()
|
||||||
get_unmounted_partition_data()
|
get_unmounted_partition_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local a_unmounted_working='' mounted_partitions='' separator='' unmounted_fs=''
|
local a_unmounted_working='' mounted_partitions='' separator='|' unmounted_fs=''
|
||||||
local dev_working='' uuid_working='' label_working=''
|
local dev_working='' uuid_working='' label_working='' a_raid_working='' raid_partitions=''
|
||||||
|
|
||||||
if [[ $B_PARTITIONS_FILE == 'true' ]];then
|
if [[ $B_PARTITIONS_FILE == 'true' ]];then
|
||||||
# set dev disk label/uuid data globals
|
# set dev disk label/uuid data globals
|
||||||
get_partition_dev_data 'label'
|
get_partition_dev_data 'label'
|
||||||
get_partition_dev_data 'uuid'
|
get_partition_dev_data 'uuid'
|
||||||
|
# load the raid data array here so we can exclude its partitions
|
||||||
|
if [[ $B_RAID_SET != 'true' ]];then
|
||||||
|
get_raid_data
|
||||||
|
fi
|
||||||
|
# sr0 type cd drives are showing up now as unmounted partitions
|
||||||
|
mounted_partitions="sr[0-9]|cdrom[0-9]*|dvd[0-9]*"
|
||||||
# create list for slicing out the mounted partitions
|
# create list for slicing out the mounted partitions
|
||||||
for (( i=0; i < ${#A_PARTITION_DATA[@]}; i++ ))
|
for (( i=0; i < ${#A_PARTITION_DATA[@]}; i++ ))
|
||||||
do
|
do
|
||||||
|
@ -7550,11 +7556,22 @@ get_unmounted_partition_data()
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
if [[ -n ${a_unmounted_working[6]} ]];then
|
if [[ -n ${a_unmounted_working[6]} ]];then
|
||||||
mounted_partitions="$mounted_partitions$separator${a_unmounted_working[6]}"
|
mounted_partitions="$mounted_partitions$separator${a_unmounted_working[6]}"
|
||||||
separator='|'
|
fi
|
||||||
|
done
|
||||||
|
# now we need to exclude the mdraid partitions from the unmounted partition output as well
|
||||||
|
for (( i=0; i < ${#A_RAID_DATA[@]}; i++ ))
|
||||||
|
do
|
||||||
|
IFS=","
|
||||||
|
a_raid_working=( ${A_RAID_DATA[i]} )
|
||||||
|
IFS="$ORIGINAL_IFS"
|
||||||
|
if [[ -n ${a_raid_working[3]} ]];then
|
||||||
|
raid_partitions=$( sed $SED_RX 's/(\([^\)]*\)|\[[^\]]*\])//g' <<< ${a_raid_working[3]}\
|
||||||
|
| sed 's/[[:space:]]\+/|/g' )
|
||||||
|
mounted_partitions="$mounted_partitions$separator$raid_partitions"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
A_UNMOUNTED_PARTITION_DATA=( $( grep -Ev '('$mounted_partitions')$' $FILE_PARTITIONS | gawk '
|
A_UNMOUNTED_PARTITION_DATA=( $( grep -Ev '[[:space:]]('$mounted_partitions')$' $FILE_PARTITIONS | gawk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
}
|
}
|
||||||
|
@ -9377,7 +9394,9 @@ print_raid_data()
|
||||||
if [[ $BSD_TYPE == 'bsd' ]];then
|
if [[ $BSD_TYPE == 'bsd' ]];then
|
||||||
dev_string=''
|
dev_string=''
|
||||||
fi
|
fi
|
||||||
get_raid_data
|
if [[ $B_RAID_SET != 'true' ]];then
|
||||||
|
get_raid_data
|
||||||
|
fi
|
||||||
|
|
||||||
for (( i=0; i < ${#A_RAID_DATA[@]}; i++ ))
|
for (( i=0; i < ${#A_RAID_DATA[@]}; i++ ))
|
||||||
do
|
do
|
||||||
|
|
2
inxi.1
2
inxi.1
|
@ -145,6 +145,8 @@ Shows file system type if you have file installed, if you are root OR if you hav
|
||||||
added to /etc/sudoers (sudo v. 1.7 or newer):
|
added to /etc/sudoers (sudo v. 1.7 or newer):
|
||||||
|
|
||||||
.B <username> ALL = NOPASSWD: /usr/bin/file (sample)
|
.B <username> ALL = NOPASSWD: /usr/bin/file (sample)
|
||||||
|
|
||||||
|
Does not show components (partitions that create the md raid array) of md-raid arrays.
|
||||||
.TP
|
.TP
|
||||||
.B -p
|
.B -p
|
||||||
Show full partition information (\fB-P\fR plus all other detected partitions).
|
Show full partition information (\fB-P\fR plus all other detected partitions).
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
=====================================================================================
|
||||||
|
Version: 1.8.41
|
||||||
|
Patch Version: 00
|
||||||
|
Script Date: February 27 2013
|
||||||
|
-----------------------------------
|
||||||
|
Changes:
|
||||||
|
-----------------------------------
|
||||||
|
New version, updated man page. A bug fix for an old time bug: with mdraid, -o (unmounted
|
||||||
|
partitions) would show components of the md raid array as unmounted partitions.
|
||||||
|
|
||||||
|
This is of course incorrect, and is now fixed.
|
||||||
|
|
||||||
|
Small update of man page as well to note that -o will not show components of mdraid arrays.
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
-- Harald Hope - Wed, 27 Feb 2013 22:09:32 -0800
|
||||||
|
|
||||||
=====================================================================================
|
=====================================================================================
|
||||||
Version: 1.8.40
|
Version: 1.8.40
|
||||||
Patch Version: 00
|
Patch Version: 00
|
||||||
|
|
Loading…
Reference in a new issue