mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
added plural network ports
This commit is contained in:
parent
e853fed8ff
commit
9f64dfd4ab
15
inxi
15
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.6.0-b1-t9
|
||||
#### version: 0.6.0-b1-t10
|
||||
#### Date: November 20 2008
|
||||
########################################################################
|
||||
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
|
||||
|
@ -2422,7 +2422,7 @@ print_info_data()
|
|||
print_networking_data()
|
||||
{
|
||||
local i='' card_one='Card-1' network_data='' a_network_working='' port_data='' driver_data=''
|
||||
local card_string=''
|
||||
local card_string='' port_plural=''
|
||||
# set A_NETWORK_DATA
|
||||
get_networking_data
|
||||
|
||||
|
@ -2441,7 +2441,10 @@ print_networking_data()
|
|||
driver_data=" ${C1}driver${C2} ${a_network_working[1]}"
|
||||
fi
|
||||
if [[ -n ${a_network_working[2]} && $B_EXTRA_DATA == 'true' ]];then
|
||||
port_data=" ${C1}at port${C2} ${a_network_working[2]}"
|
||||
if [[ $( wc -w <<< ${a_network_working[2]} ) -gt 1 ]];then
|
||||
port_plural='s'
|
||||
fi
|
||||
port_data=" ${C1}at port$port_plural${C2} ${a_network_working[2]}"
|
||||
fi
|
||||
card_string=""
|
||||
network_data="${C1}$card_one${C2} ${a_network_working[0]}$driver_data$port_data"
|
||||
|
@ -2455,11 +2458,15 @@ print_networking_data()
|
|||
IFS="$ORIGINAL_IFS"
|
||||
port_data=''
|
||||
driver_data=''
|
||||
port_plural=''
|
||||
if [[ -n ${a_network_working[1]} ]];then
|
||||
driver_data=" ${C1}driver${C2} ${a_network_working[1]}"
|
||||
fi
|
||||
if [[ -n ${a_network_working[2]} && $B_EXTRA_DATA == 'true' ]];then
|
||||
port_data=" ${C1}at port${C2} ${a_network_working[2]}"
|
||||
if [[ $( wc -w <<< ${a_network_working[2]} ) -gt 1 ]];then
|
||||
port_plural='s'
|
||||
fi
|
||||
port_data=" ${C1}at port$port_plural${C2} ${a_network_working[2]}"
|
||||
fi
|
||||
network_data="${C1}Card-$(( $i + 1 )) ${C2}${a_network_working[0]}$driver_data$port_data"
|
||||
network_data=$( create_print_line " " "$network_data" )
|
||||
|
|
Loading…
Reference in a new issue