mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
this is to replace the debugger branches/one with a current good one just to make sure nobody grabs it by accident.
This commit is contained in:
parent
d1e44e91a8
commit
09caecca6a
57
inxi
57
inxi
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.7.8
|
#### version: 1.7.9
|
||||||
#### Date: June 22 2011
|
#### Date: June 22 2011
|
||||||
#### Patch Number: 08-debug
|
#### Patch Number: 00
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -2713,18 +2713,14 @@ get_audio_usb_data()
|
||||||
local temp_array=''
|
local temp_array=''
|
||||||
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
echo "get usb path: $( date +%H:%M:%S )"
|
|
||||||
lsusb_path=$( type -p lsusb )
|
lsusb_path=$( type -p lsusb )
|
||||||
if [[ -n $lsusb_path ]];then
|
if [[ -n $lsusb_path ]];then
|
||||||
echo "get usb data: $( date +%H:%M:%S )"
|
|
||||||
lsusb_data=$( $lsusb_path 2>/dev/null )
|
lsusb_data=$( $lsusb_path 2>/dev/null )
|
||||||
echo "gotten usb data: $( date +%H:%M:%S )"
|
|
||||||
fi
|
fi
|
||||||
log_function_data 'raw' "usb_data:\n$lsusb_data"
|
log_function_data 'raw' "usb_data:\n$lsusb_data"
|
||||||
if [[ -n $lsusb_data ]];then
|
if [[ -n $lsusb_data ]];then
|
||||||
# for every sound card symlink in /proc/asound - display information about it
|
# for every sound card symlink in /proc/asound - display information about it
|
||||||
echo "start loop: $( date +%H:%M:%S )"
|
for usb_proc_file in /proc/asound/*
|
||||||
time for usb_proc_file in /proc/asound/*
|
|
||||||
do
|
do
|
||||||
# If the file is a symlink, and contains an important usb exclusive file: continue
|
# If the file is a symlink, and contains an important usb exclusive file: continue
|
||||||
if [[ -L $usb_proc_file && -e $usb_proc_file/usbid ]]; then
|
if [[ -L $usb_proc_file && -e $usb_proc_file/usbid ]]; then
|
||||||
|
@ -2733,10 +2729,7 @@ get_audio_usb_data()
|
||||||
usb_id=$( cat $usb_proc_file/usbid )
|
usb_id=$( cat $usb_proc_file/usbid )
|
||||||
usb_data=$( grep "$usb_id" <<< "$lsusb_data" )
|
usb_data=$( grep "$usb_id" <<< "$lsusb_data" )
|
||||||
if [[ -n $usb_data && -n $usb_id ]];then
|
if [[ -n $usb_data && -n $usb_id ]];then
|
||||||
# usb_data=$(
|
usb_data=$( gawk '
|
||||||
echo "pre gawk when found: $( date +%H:%M:%S )"
|
|
||||||
echo $usb_data
|
|
||||||
time gawk '
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
string=""
|
string=""
|
||||||
|
@ -2751,13 +2744,12 @@ get_audio_usb_data()
|
||||||
separator = " "
|
separator = " "
|
||||||
}
|
}
|
||||||
if ( $6 != "" ){
|
if ( $6 != "" ){
|
||||||
print string ",snd-usb-audio,,," $6
|
print string ",USB Audio,,," $6
|
||||||
}
|
}
|
||||||
}' <<< "$usb_data"
|
}' <<< "$usb_data" )
|
||||||
# )
|
|
||||||
fi
|
fi
|
||||||
# this method is interesting, it shouldn't work but it does
|
# this method is interesting, it shouldn't work but it does
|
||||||
#A_AUDIO_DATA=( "${A_AUDIO_DATA[@]}" "$usb_data,snd-usb-audio,," )
|
#A_AUDIO_DATA=( "${A_AUDIO_DATA[@]}" "$usb_data,USB Audio,," )
|
||||||
# but until we learn why the above worked, I'm using this one, which is safer
|
# but until we learn why the above worked, I'm using this one, which is safer
|
||||||
if [[ -n $usb_data ]];then
|
if [[ -n $usb_data ]];then
|
||||||
array_count=${#A_AUDIO_DATA[@]}
|
array_count=${#A_AUDIO_DATA[@]}
|
||||||
|
@ -2772,9 +2764,7 @@ get_audio_usb_data()
|
||||||
|
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
echo "start: $( date +%H:%M:%S )"
|
|
||||||
time get_audio_usb_data
|
|
||||||
echo "finish: $( date +%H:%M:%S )"
|
|
||||||
get_audio_alsa_data()
|
get_audio_alsa_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
|
@ -4326,7 +4316,17 @@ get_network_advanced_data()
|
||||||
oper_state=''
|
oper_state=''
|
||||||
usb_data=''
|
usb_data=''
|
||||||
if [[ -z $( grep '^usb-' <<< ${a_network_adv_working[4]} ) ]];then
|
if [[ -z $( grep '^usb-' <<< ${a_network_adv_working[4]} ) ]];then
|
||||||
|
# note although this may exist technically don't use it, it's a virtual path
|
||||||
|
# and causes weird cat errors when there's a missing file as well as a virtual path
|
||||||
|
# /sys/bus/pci/devices/0000:02:02.0/net/eth1
|
||||||
|
# real paths are: /sys/devices/pci0000:00/0000:00:1e/0/0000:02:02.0/net/eth1/uevent
|
||||||
|
# and on older debian kernels: /sys/devices/pci0000:00/0000:02:02.0/net:eth1/uevent
|
||||||
working_path="/sys/bus/pci/devices/0000:${a_network_adv_working[4]}"
|
working_path="/sys/bus/pci/devices/0000:${a_network_adv_working[4]}"
|
||||||
|
# now we want the real one, that xiin also displays, without symbolic links.
|
||||||
|
if [[ -e $working_path ]];then
|
||||||
|
working_path=$( readlink -f $working_path 2>/dev/null )
|
||||||
|
fi
|
||||||
|
# working_path=$( ls /sys/devices/pci*/*/0000:${a_network_adv_working[4]}/net/*/uevent )
|
||||||
else
|
else
|
||||||
# slice off the usb- part
|
# slice off the usb- part
|
||||||
usb_data=$( cut -d '-' -f 2-4 <<< ${a_network_adv_working[4]} )
|
usb_data=$( cut -d '-' -f 2-4 <<< ${a_network_adv_working[4]} )
|
||||||
|
@ -4389,17 +4389,17 @@ get_network_advanced_data()
|
||||||
log_function_data "POST: working_path: $working_path\nif_path: $if_path - if_id: $if_id"
|
log_function_data "POST: working_path: $working_path\nif_path: $if_path - if_id: $if_id"
|
||||||
|
|
||||||
if [[ -n $if_path ]];then
|
if [[ -n $if_path ]];then
|
||||||
if [[ -f $working_path/speed ]];then
|
if [[ -r $working_path/speed ]];then
|
||||||
speed=$( cat $working_path/speed )
|
speed=$( cat $working_path/speed 2>/dev/null )
|
||||||
fi
|
fi
|
||||||
if [[ -f $working_path/duplex ]];then
|
if [[ -r $working_path/duplex ]];then
|
||||||
duplex=$( cat $working_path/duplex )
|
duplex=$( cat $working_path/duplex 2>/dev/null )
|
||||||
fi
|
fi
|
||||||
if [[ -f $working_path/address ]];then
|
if [[ -r $working_path/address ]];then
|
||||||
mac_id=$( cat $working_path/address )
|
mac_id=$( cat $working_path/address 2>/dev/null )
|
||||||
fi
|
fi
|
||||||
if [[ -f $working_path/operstate ]];then
|
if [[ -r $working_path/operstate ]];then
|
||||||
oper_state=$( cat $working_path/operstate )
|
oper_state=$( cat $working_path/operstate 2>/dev/null )
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -4424,7 +4424,6 @@ get_networking_usb_data()
|
||||||
if [[ -n $lsusb_path ]]; then
|
if [[ -n $lsusb_path ]]; then
|
||||||
# send error messages of lsusb to /dev/null as it will display a bunch if not a super user
|
# send error messages of lsusb to /dev/null as it will display a bunch if not a super user
|
||||||
lsusb_data="$( $lsusb_path 2>/dev/null )"
|
lsusb_data="$( $lsusb_path 2>/dev/null )"
|
||||||
|
|
||||||
# set spaces to |
|
# set spaces to |
|
||||||
USB_NETWORK_SEARCH=$( sed 's/[[:space:]]\+/|/g' <<< $USB_NETWORK_SEARCH )
|
USB_NETWORK_SEARCH=$( sed 's/[[:space:]]\+/|/g' <<< $USB_NETWORK_SEARCH )
|
||||||
# also, find the contents of usbid in lsusb and print everything after the 7th word on the
|
# also, find the contents of usbid in lsusb and print everything after the 7th word on the
|
||||||
|
@ -6077,7 +6076,7 @@ print_audio_data()
|
||||||
port_data=" ${C1}port$port_plural${C2} ${a_audio_working[2]}"
|
port_data=" ${C1}port$port_plural${C2} ${a_audio_working[2]}"
|
||||||
fi
|
fi
|
||||||
if [[ -n ${a_audio_working[4]} && $B_EXTRA_DATA == 'true' ]];then
|
if [[ -n ${a_audio_working[4]} && $B_EXTRA_DATA == 'true' ]];then
|
||||||
if [[ ${a_audio_working[1]} != 'snd-usb-audio' ]];then
|
if [[ ${a_audio_working[1]} != 'USB Audio' ]];then
|
||||||
bus_usb_text='bus-ID'
|
bus_usb_text='bus-ID'
|
||||||
else
|
else
|
||||||
bus_usb_text='usb-ID'
|
bus_usb_text='usb-ID'
|
||||||
|
@ -6773,7 +6772,7 @@ print_networking_data()
|
||||||
fi
|
fi
|
||||||
card_string="${C1}Card$card_id${C2} ${a_network_working[0]} "
|
card_string="${C1}Card$card_id${C2} ${a_network_working[0]} "
|
||||||
card_data="$driver_data$port_data$pci_bus_id"
|
card_data="$driver_data$port_data$pci_bus_id"
|
||||||
if [[ $( calculate_line_length "$card_string$card_data" ) -lt $LINE_MAX ]];then
|
if [[ $( calculate_line_length "$card_string$card_data" ) -gt $LINE_MAX ]];then
|
||||||
network_data=$( create_print_line "$line_starter" "$card_string" )
|
network_data=$( create_print_line "$line_starter" "$card_string" )
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
card_string=''
|
card_string=''
|
||||||
|
|
Loading…
Reference in a new issue