]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/network
Add function that returns a string about speed and duplex state of an interface
[people/ms/network.git] / src / network
index d6a0817ff3be746f354bf43346b331ff750fea17..1999c3d5dc62b874114805989b2c3dd2e8419647 100644 (file)
@@ -133,12 +133,10 @@ function cli_device_status() {
 
        # Print the link speed for ethernet devices.
        if device_is_up ${device} &>/dev/null; then
-               case "${type}" in
-                       ethernet)
-                               cli_print_fmt1 1 "Link" \
-                                       "$(device_get_speed ${device}) MBit/s $(device_get_duplex ${device}) duplex"
-                               ;;
-               esac
+               local link="$(device_get_link_string "${device}")"
+               if isset link; then
+                       cli_print_fmt1 1 "Link" "${link}"
+               fi
        fi
 
        cli_print_fmt1 1 "MTU"          "$(device_get_mtu ${device})"