From: Michael Tremer Date: Tue, 23 Dec 2014 00:51:59 +0000 (+0000) Subject: Show if the device is able to transport Ethernet frames X-Git-Tag: 007~58 X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fnetwork.git;a=commitdiff_plain;h=a4f7ad2665aad3422514db9b9071ffea509dbfa6 Show if the device is able to transport Ethernet frames --- diff --git a/src/functions/functions.device b/src/functions/functions.device index 97eb17f7..d4318f84 100644 --- a/src/functions/functions.device +++ b/src/functions/functions.device @@ -389,6 +389,14 @@ function device_get_type() { fi } +function device_is_ethernet_compatible() { + local device="${1}" + + # /sys/class/net/*/type must equal 1 for ethernet compatible devices + local type="$(__device_get_file "${device}" "type")" + [[ "${type}" = "1" ]] +} + function device_get_status() { local device=${1} assert isset device diff --git a/src/network b/src/network index eccf2f43..fda05a23 100644 --- a/src/network +++ b/src/network @@ -128,6 +128,11 @@ function cli_device_status() { cli_print_fmt1 1 "Status" "${status}" cli_print_fmt1 1 "Type" "${type}" + + # Ethernet-compatible? + device_is_ethernet_compatible "${device}" &>/dev/null + cli_print_fmt1 1 "Ethernet-compatible" "$(cli_print_bool $?)" + cli_print_fmt1 1 "Address" "$(device_get_address ${device})" cli_space