mirror of
https://github.com/smxi/inxi.git
synced 2025-01-31 10:02:18 +00:00
New version, tarball, man page. Added floppy disk support, basic, for -d. Fixed a
long-standing issue where /dev/ram.. data shows in unmounted disks output. This is now properly filtered out. Note that the floppy disk output has no information beyond it's /dev id, eg: /dev/fd0 I could find no meaningful data in /sys related to the floppy disk, not the model, etc, so I'm just showing presence of disk.
This commit is contained in:
parent
b0d1e4976a
commit
5e3609a279
88
inxi
88
inxi
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### Version: 2.3.19
|
#### Version: 2.3.20
|
||||||
#### Date: 2017-06-10
|
#### Date: 2017-06-12
|
||||||
#### Patch Number: 00
|
#### Patch Number: 00
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
|
@ -3115,7 +3115,7 @@ show_options()
|
||||||
print_lines_basic "2" "98" "Console IRC not in X"
|
print_lines_basic "2" "98" "Console IRC not in X"
|
||||||
print_lines_basic "2" "99" "Global - Overrides/removes all settings. Setting specific removes global."
|
print_lines_basic "2" "99" "Global - Overrides/removes all settings. Setting specific removes global."
|
||||||
print_lines_basic "1" "-C" "CPU output, including per CPU clockspeed and max CPU speed (if available)."
|
print_lines_basic "1" "-C" "CPU output, including per CPU clockspeed and max CPU speed (if available)."
|
||||||
print_lines_basic "1" "-d" "Optical drive data. Same as -Dd. See also -x and -xx."
|
print_lines_basic "1" "-d" "Optical drive data (and floppy disks, if present). Same as -Dd. See also -x and -xx."
|
||||||
print_lines_basic "1" "-D" "Full hard Disk info, not only model, ie: /dev/sda ST380817AS 80.0GB. See also -x and -xx. Disk total used percentage includes swap partition size(s)."
|
print_lines_basic "1" "-D" "Full hard Disk info, not only model, ie: /dev/sda ST380817AS 80.0GB. See also -x and -xx. Disk total used percentage includes swap partition size(s)."
|
||||||
print_lines_basic "1" "-f" "All cpu flags, triggers -C. Not shown with -F to avoid spamming. ARM cpus show 'features'."
|
print_lines_basic "1" "-f" "All cpu flags, triggers -C. Not shown with -F to avoid spamming. ARM cpus show 'features'."
|
||||||
print_lines_basic "1" "-F" "Full output for $SCRIPT_NAME. Includes all Upper Case line letters, plus -s and -n. Does not show extra verbose options like -d -f -l -m -o -p -r -t -u -x"
|
print_lines_basic "1" "-F" "Full output for $SCRIPT_NAME. Includes all Upper Case line letters, plus -s and -n. Does not show extra verbose options like -d -f -l -m -o -p -r -t -u -x"
|
||||||
|
@ -8428,7 +8428,7 @@ get_optical_drive_data()
|
||||||
local a_temp='' sys_uevent_path='' proc_cdrom='' link_list=''
|
local a_temp='' sys_uevent_path='' proc_cdrom='' link_list=''
|
||||||
local separator='' linked='' working_disk='' disk='' item_string='' proc_info_string=''
|
local separator='' linked='' working_disk='' disk='' item_string='' proc_info_string=''
|
||||||
local dev_disks_full=''
|
local dev_disks_full=''
|
||||||
dev_disks_full="$( ls /dev/dvd* /dev/cd* /dev/scd* /dev/sr* 2>/dev/null | grep -vE 'random' )"
|
dev_disks_full="$( ls /dev/dvd* /dev/cd* /dev/scd* /dev/sr* /dev/fd[0-9] 2>/dev/null | grep -vE 'random' )"
|
||||||
## Not using this now because newer kernel is NOT linking all optical drives. Some, but not all
|
## Not using this now because newer kernel is NOT linking all optical drives. Some, but not all
|
||||||
# Some systems don't support xargs -L plus the unlinked optical drive unit make this not a good option
|
# Some systems don't support xargs -L plus the unlinked optical drive unit make this not a good option
|
||||||
# get the actual disk dev location, first try default which is easier to run, need to preserve line breaks
|
# get the actual disk dev location, first try default which is easier to run, need to preserve line breaks
|
||||||
|
@ -11412,8 +11412,8 @@ get_unmounted_partition_data()
|
||||||
if [[ $B_RAID_SET != 'true' ]];then
|
if [[ $B_RAID_SET != 'true' ]];then
|
||||||
get_raid_data
|
get_raid_data
|
||||||
fi
|
fi
|
||||||
# sr0 type cd drives are showing up now as unmounted partitions
|
# sr0 type cd drives are showing up now as unmounted partitions.
|
||||||
mounted_partitions="scd[0-9]+|sr[0-9]+|cdrom[0-9]*|cdrw[0-9]*|dvd[0-9]*|dvdrw[0-9]*"
|
mounted_partitions="scd[0-9]+|sr[0-9]+|cdrom[0-9]*|cdrw[0-9]*|dvd[0-9]*|dvdrw[0-9]*|fd[0-9]|ram[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
|
||||||
|
@ -11436,18 +11436,18 @@ get_unmounted_partition_data()
|
||||||
mounted_partitions="$mounted_partitions$separator$raid_partitions"
|
mounted_partitions="$mounted_partitions$separator$raid_partitions"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
# grep -Ev '[[:space:]]('$mounted_partitions')$' $FILE_PARTITIONS |
|
||||||
A_UNMOUNTED_PARTITION_DATA=( $( grep -Ev '[[:space:]]('$mounted_partitions')$' $FILE_PARTITIONS | gawk '
|
A_UNMOUNTED_PARTITION_DATA=( $( gawk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
}
|
}
|
||||||
# note that size 1 means it is a logical extended partition container
|
# note that size 1 means it is a logical extended partition container
|
||||||
# lvm might have dm-1 type syntax
|
# lvm might have dm-1 type syntax
|
||||||
# need to exclude loop type file systems, squashfs for example
|
# need to exclude loop type file systems, squashfs for example
|
||||||
/[a-z][0-9]+$|dm-[0-9]+$/ && $3 != 1 && $NF !~ /loop/ {
|
/[a-z][0-9]+$|dm-[0-9]+$/ && $3 != 1 && $NF !~ /loop/ && $NF !~ /('$mounted_partitions')/ {
|
||||||
size = sprintf( "%.2f", $3*1024/1000**3 )
|
size = sprintf( "%.2f", $3*1024/1000**3 )
|
||||||
print $4 "," size "G"
|
print $4 "," size "G"
|
||||||
}' ) )
|
}' $FILE_PARTITIONS ) )
|
||||||
|
|
||||||
for (( i=0; i < ${#A_UNMOUNTED_PARTITION_DATA[@]}; i++ ))
|
for (( i=0; i < ${#A_UNMOUNTED_PARTITION_DATA[@]}; i++ ))
|
||||||
do
|
do
|
||||||
|
@ -13911,6 +13911,7 @@ print_optical_drive_data()
|
||||||
local a_drives='' drive_data='' counter='' dev_string='/dev/' speed_string='x'
|
local a_drives='' drive_data='' counter='' dev_string='/dev/' speed_string='x'
|
||||||
local drive_id='' drive_links='' vendor='' speed='' multisession='' mcn='' audio=''
|
local drive_id='' drive_links='' vendor='' speed='' multisession='' mcn='' audio=''
|
||||||
local dvd='' state='' rw_support='' rev='' separator='' drive_string='' part_2_data=''
|
local dvd='' state='' rw_support='' rev='' separator='' drive_string='' part_2_data=''
|
||||||
|
local drive_type='Optical' fd_counter=0 opt_counter=0 b_floppy='false'
|
||||||
if [[ -z $BSD_TYPE ]];then
|
if [[ -z $BSD_TYPE ]];then
|
||||||
get_optical_drive_data
|
get_optical_drive_data
|
||||||
else
|
else
|
||||||
|
@ -13946,43 +13947,56 @@ print_optical_drive_data()
|
||||||
drive_string="No optical drives detected."
|
drive_string="No optical drives detected."
|
||||||
B_SHOW_FULL_OPTICAL='false'
|
B_SHOW_FULL_OPTICAL='false'
|
||||||
else
|
else
|
||||||
if [[ ${#A_OPTICAL_DRIVE_DATA[@]} -gt 1 ]];then
|
if [[ -n ${a_drives[0]/fd*/} ]];then
|
||||||
counter="-$(( i + 1 ))"
|
opt_counter=$(( $opt_counter + 1 ))
|
||||||
|
counter="-$opt_counter"
|
||||||
|
drive_type='Optical'
|
||||||
|
b_floppy='false'
|
||||||
|
else
|
||||||
|
fd_counter=$(( $fd_counter + 1 ))
|
||||||
|
counter="-$fd_counter"
|
||||||
|
drive_type='Floppy'
|
||||||
|
b_floppy='true'
|
||||||
fi
|
fi
|
||||||
if [[ -z ${a_drives[0]} ]];then
|
if [[ -z ${a_drives[0]} ]];then
|
||||||
drive_id='N/A'
|
drive_id='N/A'
|
||||||
else
|
else
|
||||||
drive_id="$dev_string${a_drives[0]}"
|
drive_id="$dev_string${a_drives[0]}"
|
||||||
fi
|
fi
|
||||||
drive_links=$( sed 's/~/,/g' <<< ${a_drives[1]} )
|
if [[ $b_floppy == 'false' ]];then
|
||||||
if [[ -z $drive_links ]];then
|
drive_links=$( sed 's/~/,/g' <<< ${a_drives[1]} )
|
||||||
drive_links='N/A'
|
if [[ -z $drive_links ]];then
|
||||||
fi
|
drive_links='N/A'
|
||||||
if [[ -n ${a_drives[2]} ]];then
|
|
||||||
vendor=${a_drives[2]}
|
|
||||||
if [[ -n ${a_drives[3]} ]];then
|
|
||||||
vendor="$vendor ${a_drives[3]}"
|
|
||||||
fi
|
fi
|
||||||
fi
|
if [[ -n ${a_drives[2]} ]];then
|
||||||
if [[ -z $vendor ]];then
|
vendor=${a_drives[2]}
|
||||||
if [[ -n ${a_drives[3]} ]];then
|
if [[ -n ${a_drives[3]} ]];then
|
||||||
vendor=${a_drives[3]}
|
vendor="$vendor ${a_drives[3]}"
|
||||||
else
|
fi
|
||||||
vendor='N/A'
|
|
||||||
fi
|
fi
|
||||||
fi
|
if [[ -z $vendor ]];then
|
||||||
if [[ $B_EXTRA_DATA == 'true' ]];then
|
if [[ -n ${a_drives[3]} ]];then
|
||||||
if [[ -n ${a_drives[4]} ]];then
|
vendor=${a_drives[3]}
|
||||||
rev=${a_drives[4]}
|
else
|
||||||
else
|
vendor='N/A'
|
||||||
rev='N/A'
|
fi
|
||||||
fi
|
fi
|
||||||
rev="${C1}rev$SEP3${C2} $rev "
|
if [[ $B_EXTRA_DATA == 'true' ]];then
|
||||||
|
if [[ -n ${a_drives[4]} ]];then
|
||||||
|
rev=${a_drives[4]}
|
||||||
|
else
|
||||||
|
rev='N/A'
|
||||||
|
fi
|
||||||
|
rev="${C1}rev$SEP3${C2} $rev "
|
||||||
|
fi
|
||||||
|
drive_string="$drive_id ${C1}model$SEP3${C2} $vendor "
|
||||||
|
part_2_data="$rev${C1}dev-links$SEP3${C2} $drive_links"
|
||||||
|
else
|
||||||
|
drive_string="$drive_id"
|
||||||
|
part_2_data=''
|
||||||
fi
|
fi
|
||||||
drive_string="$drive_id ${C1}model$SEP3${C2} $vendor "
|
|
||||||
part_2_data="$rev${C1}dev-links$SEP3${C2} $drive_links"
|
|
||||||
fi
|
fi
|
||||||
drive_data="${C1}Optical${counter}$SEP3${C2} $drive_string"
|
drive_data="${C1}$drive_type${counter}$SEP3${C2} $drive_string"
|
||||||
if [[ $( calculate_line_length "$drive_data$part_2_data" ) -lt $COLS_INNER ]];then
|
if [[ $( calculate_line_length "$drive_data$part_2_data" ) -lt $COLS_INNER ]];then
|
||||||
drive_data=$( create_print_line "$Line_Starter" "$drive_data$part_2_data" )
|
drive_data=$( create_print_line "$Line_Starter" "$drive_data$part_2_data" )
|
||||||
print_screen_output "$drive_data"
|
print_screen_output "$drive_data"
|
||||||
|
@ -14024,7 +14038,7 @@ print_optical_drive_data()
|
||||||
# 12 - dvdr
|
# 12 - dvdr
|
||||||
# 13 - dvdram
|
# 13 - dvdram
|
||||||
# 14 - state
|
# 14 - state
|
||||||
if [[ $B_SHOW_FULL_OPTICAL == 'true' ]];then
|
if [[ $B_SHOW_FULL_OPTICAL == 'true' && $b_floppy == 'false' ]];then
|
||||||
if [[ -z ${a_drives[5]} ]];then
|
if [[ -z ${a_drives[5]} ]];then
|
||||||
speed='N/A'
|
speed='N/A'
|
||||||
else
|
else
|
||||||
|
|
6
inxi.1
6
inxi.1
|
@ -1,4 +1,4 @@
|
||||||
.TH INXI 1 "2017\-06\-10" inxi "inxi manual"
|
.TH INXI 1 "2017\-06\-12" inxi "inxi manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
inxi \- Command line system information script for console and IRC
|
inxi \- Command line system information script for console and IRC
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -103,7 +103,9 @@ matches CPU max speed. If CPU max speed does not match CPU actual speed, shows b
|
||||||
information. See \fB\-x\fR and \fB\-xx\fR for more options.
|
information. See \fB\-x\fR and \fB\-xx\fR for more options.
|
||||||
.TP
|
.TP
|
||||||
.B \-d
|
.B \-d
|
||||||
Shows optical drive data. Same as \fB\-Dd\fR. With \fB\-x\fR, adds features line to output.
|
Shows optical drive data. Same as \fB\-Dd\fR. With \fB\-x\fR, adds features line to output. Also shows
|
||||||
|
floppy disks if present. Note that there is no current way to get any information about the floppy device
|
||||||
|
that I am aware of, so it will simply show the floppy id, without any extra data.
|
||||||
\fB\-xx\fR adds a few more features.
|
\fB\-xx\fR adds a few more features.
|
||||||
.TP
|
.TP
|
||||||
.B \-D
|
.B \-D
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
=====================================================================================
|
||||||
|
Version: 2.3.20
|
||||||
|
Patch Version: 00
|
||||||
|
Script Date: 2017-06-12
|
||||||
|
-----------------------------------
|
||||||
|
Changes:
|
||||||
|
-----------------------------------
|
||||||
|
New version, tarball, man page. Added floppy disk support, basic, for -d. Fixed a
|
||||||
|
long-standing issue where /dev/ram.. data shows in unmounted disks output. This is
|
||||||
|
now properly filtered out.
|
||||||
|
|
||||||
|
Note that the floppy disk output has no information beyond it's /dev id, eg: /dev/fd0
|
||||||
|
|
||||||
|
I could find no meaningful data in /sys related to the floppy disk, not the model, etc, so
|
||||||
|
I'm just showing presence of disk.
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
-- Harald Hope - Mon, 12 Jun 2017 18:31:48 -0700
|
||||||
|
|
||||||
=====================================================================================
|
=====================================================================================
|
||||||
Version: 2.3.19
|
Version: 2.3.19
|
||||||
Patch Version: 00
|
Patch Version: 00
|
||||||
|
|
Loading…
Reference in a new issue