]> git.ipfire.org Git - people/stevee/network.git/blobdiff - network
network: Don't show link speed when device is not up.
[people/stevee/network.git] / network
diff --git a/network b/network
index ef2064e7cbd94ba25b158f0b9140e225f35f72cb..c22b23f84fb9075c261e3a07abd939c465f43dbd 100755 (executable)
--- a/network
+++ b/network
@@ -123,12 +123,14 @@ function cli_device_status() {
        cli_space
 
        # Print the link speed for ethernet devices.
-       case "${type}" in
-               ethernet)
-                       cli_print_fmt1 1 "Link" \
-                               "$(device_get_speed ${device}) MBit/s $(device_get_duplex ${device}) duplex"
-                       ;;
-       esac
+       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
+       fi
 
        cli_print_fmt1 1 "MTU"          "$(device_get_mtu ${device})"
        cli_space