Also showing bridge IP addresses
This commit is contained in:
parent
180112d72d
commit
5c7ee75adc
@ -105,8 +105,8 @@ function get_ip_addresses() {
|
||||
local ips=()
|
||||
for f in /sys/class/net/*; do
|
||||
local intf=$(basename $f)
|
||||
# match only interface names starting with e (Ethernet), w (wireless), r (some Ralink drivers use ra<number> format)
|
||||
if [[ $intf =~ ^[ewr].* ]]; then
|
||||
# match only interface names starting with e (Ethernet), b (bridge), w (wireless), r (some Ralink drivers use ra<number> format)
|
||||
if [[ $intf =~ ^[ebwr].* ]]; then
|
||||
local tmp=$(ip -4 addr show dev $intf | awk '/inet/ {print $2}' | cut -d'/' -f1)
|
||||
# add both name and IP - can be informative but becomes ugly with long persistent/predictable device names
|
||||
#[[ -n $tmp ]] && ips+=("$intf: $tmp")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user