summaryrefslogtreecommitdiffstats
path: root/inxi
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2016-01-24 15:28:20 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2016-01-24 15:28:20 -0500
commitf235875e5649d9b4b5b38b6ddcc50f451bc737b8 (patch)
tree4b04662e6a3cee2e8a0efc411722460c64b91572 /inxi
parentfde479e31ad8488c3616c404fab055a671810b61 (diff)
downloadinxi-f235875e5649d9b4b5b38b6ddcc50f451bc737b8.tar.bz2
inxi-f235875e5649d9b4b5b38b6ddcc50f451bc737b8.tar.xz
inxi-f235875e5649d9b4b5b38b6ddcc50f451bc737b8.tar.zst
Imported Upstream version 2.2.32upstream/2.2.32
Diffstat (limited to 'inxi')
-rwxr-xr-xinxi96
1 files changed, 50 insertions, 46 deletions
diff --git a/inxi b/inxi
index fdebd47..56f1460 100755
--- a/inxi
+++ b/inxi
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
########################################################################
#### Script Name: inxi
-#### Version: 2.2.28
-#### Date: 2015-08-20
+#### Version: 2.2.32
+#### Date: 2016-01-03
#### Patch Number: 00
########################################################################
#### SPECIAL THANKS
@@ -625,8 +625,13 @@ DISTROS_OS_RELEASE_GOOD="arch-release SuSE-release "
## OUTPUT FILTERS/SEARCH ##
# Note that \<ltd\> bans only words, not parts of strings; in \<corp\> you can't use punctuation characters like . or ,
# we're saving about 10+% of the total script exec time by hand building the ban lists here, using hard quotes.
+
BAN_LIST_NORMAL='chipset|components|computing|computer|corporation|communications|electronics|electrical|electric|gmbh|group|incorporation|industrial|international|nee|revision|semiconductor|software|technologies|technology|ltd\.|\<ltd\>|inc\.|\<inc\>|intl\.|co\.|\<co\>|corp\.|\<corp\>|\(tm\)|\(r\)|®|\(rev ..\)'
BAN_LIST_CPU='@||cpu |cpu deca|dual core|dual-core|tri core|tri-core|quad core|quad-core|ennea|genuine|hepta|hexa|multi|octa|penta|processor|single|triple|[0-9\.]+ *[MmGg][Hh][Zz]'
+# See github issue 75 for more details on value: *, triggers weird behaviors if present in value
+# /sys/devices/virtual/dmi/id/product_name:['*']
+# this is for bash arrays AND avoiding * in arrays: ( fred * greg ) expands to the contents of the directory
+BAN_LIST_ARRAY=',|\*'
SENSORS_GPU_SEARCH='intel|radeon|nouveau'
@@ -3745,7 +3750,7 @@ get_audio_data()
audioCard=gensub(/^[0-9a-f:\.]+ [^:]+: (.+)$/,"\\1","g",$0)
# The doublequotes are necessary because of the pipes in the variable.
gsub(/'"$BAN_LIST_NORMAL"'/, "", audioCard)
- gsub(/,/, " ", audioCard)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", audioCard)
gsub(/^ +| +$/, "", audioCard)
gsub(/ [ \t]+/, " ", audioCard)
aPciBusId[audioCard] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
@@ -3753,7 +3758,7 @@ get_audio_data()
# loop until you get to the end of the data block
while (getline && !/^$/) {
- gsub( /,/, "", $0 )
+ gsub(/'"$BAN_LIST_ARRAY"'/, "", $0 )
if (/driver in use/) {
drivers[audioCard] = drivers[audioCard] gensub( /(.*): (.*)/ ,"\\2", "g" ,$0 ) ""
}
@@ -3864,7 +3869,7 @@ get_audio_usb_data()
separator=""
}
{
- gsub( /,/, " ", $0 )
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0 )
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
gsub(/ [ \t]+/, " ", $0)
for ( i=7; i<= NF; i++ ) {
@@ -3912,8 +3917,8 @@ get_audio_alsa_data()
# some alsa strings have the build date in (...)
# remove trailing . and remove possible second line if compiled by user
$0 !~ /compile/ {
- gsub( /Driver | [(].*[)]|\.$/,"",$0 )
- gsub(/,/, " ", $0)
+ gsub(/Driver | [(].*[)]|\.$/,"",$0 )
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0)
gsub(/^ +| +$/, "", $0)
gsub(/ [ \t]+/, " ", $0)
sub(/Advanced Linux Sound Architecture/, "ALSA", $0)
@@ -4072,7 +4077,7 @@ get_cpu_data()
# TAKE NOTE: \t+ will work for $FILE_CPUINFO, but SOME ARBITRARY FILE used for TESTING might contain SPACES!
# Therefore PATCH to use [ \t]+ when TESTING!
/^processor[ \t]+:/ {
- gsub(/,/, " ", $NF)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
gsub(/^ +| +$/, "", $NF)
if ( $NF ~ "^[0-9]+$" ) {
nr = $NF
@@ -4089,7 +4094,7 @@ get_cpu_data()
/^model name|^cpu\t+:/ {
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
- gsub(/,/, " ", $NF)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
gsub(/^ +| +$/, "", $NF)
gsub(/ [ \t]+/, " ", $NF)
cpu[nr, "model"] = $NF
@@ -4239,7 +4244,7 @@ get_cpu_data_bsd()
/^hw.model/ && ( bsdVersion != "darwin" ) {
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
- gsub(/,/," ",$NF)
+ gsub(/'"$BAN_LIST_ARRAY"'/," ",$NF)
sub(/[a-z]+-core/, "", $NF )
gsub(/^ +| +$|\"/, "", $NF)
gsub(/ [ \t]+/, " ", $NF)
@@ -4296,7 +4301,7 @@ get_cpu_data_bsd()
/^machdep.cpu.brand_string/ {
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
- gsub(/,/," ",$NF)
+ gsub(/'"$BAN_LIST_ARRAY"'/," ",$NF)
sub(/[a-z]+-core/, "", $NF )
gsub(/^ +| +$|\"/, "", $NF)
gsub(/ [ \t]+/, " ", $NF)
@@ -4343,7 +4348,7 @@ get_cpu_flags_bsd()
gsub(/<[a-z0-9]+>/,"", $2)
# all the flags are contained within < ... > on freebsd at least
gsub(/.*<|>.*/,"", $2)
- gsub(/,/," ", $2)
+ gsub(/'"$BAN_LIST_ARRAY"'/," ", $2)
cpuFlags = cpuFlags " " $2
}
}
@@ -4419,7 +4424,7 @@ get_cpu_ht_multicore_smp_data()
}
# array of logical processors, both HT and physical
/^processor/ {
- gsub(/,/, " ", $NF)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
gsub(/^ +| +$/, "", $NF)
if ( $NF ~ "^[0-9]+$" ) {
a_processor_id[proc_iter] = $NF
@@ -5092,7 +5097,7 @@ get_distro_data()
shopt -u nullglob
a_temp=${a_distro_glob[@]}
- log_function_data "A_GLX_DATA: $a_temp"
+ log_function_data "a_distro_glob: $a_temp"
if [[ ${#a_distro_glob[@]} -eq 1 ]];then
distro_file="$a_distro_glob"
@@ -5158,7 +5163,7 @@ get_distro_data()
}
{
gsub(/\\[a-z]/, "")
- gsub(/,/, " ")
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ")
gsub(/^ +| +$/, "")
gsub(/ [ \t]+/, " ")
print
@@ -5418,7 +5423,7 @@ get_dmidecode_data()
cutExtraTab="true"
}
gsub(/'"$BAN_LIST_NORMAL"'/, "", twoData)
- gsub(/,/, " ", twoData)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", twoData)
# clean out Handle line
# sub(/^Handle.*/,"", $0)
sub(/^[[:space:]]*Inactive.*/,"",twoData)
@@ -5429,7 +5434,7 @@ get_dmidecode_data()
# To Be Filled By O.E.M.
# strip out starting white space so that the following stuff will clear properly
sub(/^[[:space:]]+/, "", twoData)
- sub(/^Base Board .*|^Chassis .*|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*|^0x[0]+$|\[Empty\]|<Bad Index>|^\.\.$/, "", twoData)
+ sub(/^Base Board .*|^Chassis .*|empty|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*|^0x[0]+$|\[Empty\]|<Bad Index>|^\.\.$/, "", twoData)
sub(/.*(AssetTagNum|Manufacturer| Or Motherboard|PartNum.*|SerNum).*/, "", twoData)
gsub(/bios|acpi/, "", twoData)
sub(/http:\/\/www.abit.com.tw\//, "Abit", twoData)
@@ -5489,7 +5494,7 @@ get_dmesg_boot_data()
dmsg_boot_data="$( cat $FILE_DMESG_BOOT 2>/dev/null | gawk '
{
sub(/[[:space:]]*=[[:space:]]*|:[[:space:]]*/,":", $0)
- gsub(/,/," ", $0)
+ gsub(/'"$BAN_LIST_ARRAY"'/," ", $0)
gsub(/\"/, "", $0)
gsub(/[[:space:]][[:space:]]/, " ", $0)
print $0
@@ -5666,7 +5671,7 @@ get_graphics_card_data()
# card. .1 would be for example: Display Adapter with bus id x:xx.1, not the right one
/vga compatible controller|3D controller|Display controller/ {
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF)
- gsub(/,/, " ", $NF)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
gsub(/^ +| +$/, "", $NF)
gsub(/ [ \t]+/, " ", $NF)
busId=gensub(/^([0-9a-f:\.]+) (.+)$/,"\\1","",$1)
@@ -5919,7 +5924,7 @@ get_graphics_display_server_data()
}
/vendor string/ {
gsub(/the|inc|foundation|project|corporation/, "", $2)
- gsub(/,/, " ", $2)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $2)
gsub(/^ +| +$/, "", $2)
gsub(/ [ \t]+/, " ", $2)
vendorString = $2
@@ -6083,7 +6088,7 @@ get_hdd_data_basic()
# note that linux 3.2.45-grsec-9th types kernels have this type of partition name: /dev/xvdc (no number, letter)
# note: btrfs does not seem to use partition integers, just the primary /dev/sdx identifier
# df can also show /dev/disk/(by-label|by-uuid etc)
- /^\/dev\/(disk\/|mapper\/|[hsv]d[a-z][0-9]*|dm[-]?[0-9]+|ada[0-9]+p[0-9]+.*|(ad|sd|wd)[0-9]+[a-z]|md[0-9]+|[aw]d[0-9]+s.*|xvd[a-z])|^ROOT/ {
+ /^\/dev\/(disk\/|mapper\/|[hsv]d[a-z]+[0-9]*|dm[-]?[0-9]+|(ada|mmcblk)[0-9]+p[0-9]+.*|(ad|sd|wd)[0-9]+[a-z]|md[0-9]+|[aw]d[0-9]+s.*|xvd[a-z]+)|^ROOT/ {
# this handles the case where the first item is too long
# and makes df wrap output to next line, so here we advance
# it to the next line for that single case. Using df -P should
@@ -6142,9 +6147,9 @@ get_hdd_data_basic()
if [[ $B_PARTITIONS_FILE == 'true' ]];then
A_HDD_DATA=( $(
gawk -v hddUsed=$hdd_used '
- /[hsv]d[a-z]$/ {
+ /([hsv]d[a-z]+|(ada|mmcblk)[0-9]+)$/ {
driveSize = $(NF - 1)*1024/1000**3
- gsub(/,/, " ", driveSize)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", driveSize)
gsub(/^ +| +$/, "", driveSize)
printf( $NF",%.1fGB,,\n", driveSize )
}
@@ -6154,7 +6159,7 @@ get_hdd_data_basic()
# }
# special case from this data: 8 0 156290904 sda
# note: vm has 252/253/254 known starter, grsec has 202
- $1 ~ /^(3|8|22|33|202|252|253|254)$/ && $NF ~ /[hsv]d[a-z]$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) {
+ $1 ~ /^(3|8|22|33|202|252|253|254)$/ && $NF ~ /[hsv]d[a-z]+$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) {
size += $3
}
END {
@@ -6249,7 +6254,7 @@ get_hard_drive_data_advanced()
#c=gensub( /^ *vendor: (.+) +model: (.+) +rev:.*$/,"\\1 \\2","g",a[i] )
# the vendor: string is useless, and is a bug, ATA is not a vendor for example
c=gensub( /^ *vendor: (.+) +model: (.+) +rev:.*$/, "\\2", "g", a[i] )
- gsub(/,/, " ", c)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", c)
gsub(/^ +| +$/, "", c)
gsub(/ [ \t]+/, " ", c)
#print a[i]
@@ -6372,9 +6377,8 @@ get_hard_drive_data_bsd()
size=0
bSetSize="false"
}
-
- $1 ~ /^(ad|ada|sd|wd)[0-9]+(|[[:space:]]at.*)$/ {
- diskId=gensub(/^((ad|ada|sd|wd)[0-9]+)[^0-9].*/,"\\1",1,$1)
+ $1 ~ /^(ad|ada|mmcblk|sd|wd)[0-9]+(|[[:space:]]at.*)$/ {
+ diskId=gensub(/^((ad|ada|mmcblk|sd|wd)[0-9]+)[^0-9].*/,"\\1",1,$1)
# note: /var/run/dmesg.boot may repeat items since it is not created
# fresh every boot, this way, only the last items will be used per disk id
if (aIds[diskId] == "" ) {
@@ -6745,13 +6749,13 @@ get_machine_data()
}
{
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
- gsub(/,/, " ", $0)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0)
# yes, there is a typo in a user data set, unknow
# Base Board Version|Base Board Serial Number
# Chassis Manufacturer|Chassis Version|Chassis Serial Number
# System manufacturer|System Product Name|System Version
# To Be Filled By O.E.M.
- sub(/^Base Board .*|^Chassis .*|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*/, "", $0)
+ sub(/^Base Board .*|^Chassis .*|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*/, "", $0)
gsub(/bios|acpi/, "", $0)
sub(/http:\/\/www.abit.com.tw\//, "Abit", $0)
gsub(/^ +| +$/, "", $0)
@@ -6877,8 +6881,8 @@ get_machine_data()
A_MACHINE_DATA=( $array_string )
IFS="$ORIGINAL_IFS"
# echo ${A_MACHINE_DATA[5]}
- a_temp=( ${A_MACHINE_DATA[@]} )
- # echo ${#a_temp[@]}
+ a_temp=${A_MACHINE_DATA[@]}
+ # echo $a_temp
log_function_data "A_MACHINE_DATA: $a_temp"
eval $LOGFE
}
@@ -7022,7 +7026,7 @@ get_module_version_number()
IGNORECASE=1
}
/^version/ {
- gsub(/,/, " ", $2)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $2)
gsub(/^ +| +$/, "", $2)
gsub(/ [ \t]+/, " ", $2)
print $2
@@ -7059,12 +7063,12 @@ get_networking_data()
#gsub(/davicom semiconductor/, "Davicom", aNic[counter])
# The doublequotes are necessary because of the pipes in the variable.
gsub(/'"$BAN_LIST_NORMAL"'/, "", aNic[counter])
- gsub(/,/, " ", aNic[counter])
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", aNic[counter])
gsub(/^ +| +$/, "", aNic[counter])
gsub(/ [ \t]+/, " ", aNic[counter])
aPciBusId[counter] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
while ( getline && !/^$/ ) {
- gsub(/,/, "", $0)
+ gsub(/'"$BAN_LIST_ARRAY"'/, "", $0)
if ( /^[[:space:]]*I\/O/ ) {
aPorts[counter] = aPorts[counter] $4 " "
}
@@ -7329,7 +7333,7 @@ get_networking_usb_data()
}
/'"$USB_NETWORK_SEARCH"'/ && !/bluetooth| hub|keyboard|mouse|printer| ps2|reader|scan|storage/ {
string=""
- gsub( /,/, " ", $0 )
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0 )
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
gsub(/ [ \t]+/, " ", $0)
#sub(/realtek semiconductor/, "Realtek", $0)
@@ -7464,7 +7468,7 @@ get_networking_local_ip_data()
/^[a-zA-Z]+[0-9]/ {
# not clear on why inet is coming through, but this gets rid of it
# as first line item.
- gsub(/,/, " ", $0)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0)
gsub(/^ +| +$/, "", $0)
gsub(/ [ \t]+/, " ", $0)
interface = $1
@@ -7648,7 +7652,7 @@ get_optical_drive_data()
{
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
sub(/TSSTcorp/, "TSST ", $0) # seen more than one of these weird ones
- gsub(/,/, " ", $0)
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0)
gsub(/^[[:space:]]*|[[:space:]]*$/, "", $0)
gsub(/ [[:space:]]+/, " ", $0)
print $0
@@ -7994,7 +7998,7 @@ get_partition_data()
}
else {
# for openbsd: /dev/wd0f on /usr type ffs (local, nodev)
- gsub( /^.*type[[:space:]]+|[[:space:]]*$/, "", $1 )
+ gsub(/^.*type[[:space:]]+|[[:space:]]*$/, "", $1 )
fileSystem=$1
}
print fileSystem
@@ -8073,7 +8077,7 @@ get_partition_data_advanced()
partTemp = ""
}
# trying to handle space in name
-# gsub( /\\040/, " ", $0 )
+# gsub(/\\040/, " ", $0 )
/[ \t]'$mount_point'[ \t]/ && $1 != "rootfs" {
# initialize the variables
label = ""
@@ -8096,7 +8100,7 @@ get_partition_data_advanced()
# if this works, great, otherwise, just set this to null values
partTemp="'$( readlink /dev/root 2>/dev/null )'"
if ( partTemp != "" ) {
- if ( partTemp ~ /[hsv]d[a-z][0-9]{1,2}/ ) {
+ if ( partTemp ~ /[hsv]d[a-z]+[0-9]{1,2}/ ) {
partition=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, partTemp )
}
else if ( partTemp ~ /by-uuid/ ) {
@@ -8150,7 +8154,7 @@ get_partition_data_advanced()
elif [[ -n $DEV_DISK_LABEL && -n $dev_label ]];then
dev_item=$( echo "$DEV_DISK_LABEL" | gawk '
# first we need to change space x20 in by-label back to a real space
- #gsub( /x20/, " ", $0 )
+ #gsub(/x20/, " ", $0 )
# then we can see if the string is there
$0 ~ /[ \t]'$dev_label'[ \t]/ {
item=gensub( /..\/..\/(.+)/, "\\1", 1, $NF )
@@ -8669,7 +8673,7 @@ get_raid_data()
uData = ""
while ( !/^[[:space:]]*$/ ) {
- gsub(/,/, " ", $0 )
+ gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0 )
gsub(/[[:space:]]+/, " ", $0 )
if ( $0 ~ /^md/ ) {
device = gensub(/(md.*)[[:space:]]?:/, "\\1", "1", $1 )
@@ -9539,7 +9543,7 @@ get_repo_data()
urlData=""
repoTitle=""
}
- gsub( /\[|\]/, "", $1 ) # strip out the brackets
+ gsub(/\[|\]/, "", $1 ) # strip out the brackets
repoTitle = $1 " ~ "
}
/^(mirrorlist|baseurl)/ {
@@ -9692,7 +9696,7 @@ get_repo_data()
urlData=""
repoTitle=""
}
- gsub( /\[|\]/, "", $1 ) # strip out the brackets
+ gsub(/\[|\]/, "", $1 ) # strip out the brackets
repoTitle = $1 " ~ "
}
/^(sync-uri)/ {
@@ -9870,7 +9874,7 @@ get_repo_data()
repoUrl=""
enabled=""
while ( getline && $0 !~ /^[[:space:]]*$/ ) {
- gsub(/,/,"",$0)
+ gsub(/'"$BAN_LIST_ARRAY"'/,"",$0)
gsub(/({|}|^[[:space:]]+|[[:space:]]+$)/,"",$1)
gsub(/({|}|^[[:space:]]+|[[:space:]]+$)/,"",$2)
if ( $1 == "url" ) {