From: Michael Tremer Date: Fri, 3 Aug 2012 10:26:46 +0000 (+0000) Subject: network: Don't show link speed when device is not up. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=245dffc985666bc094f825763e27d1f1ceed95bc;p=people%2Fstevee%2Fnetwork.git network: Don't show link speed when device is not up. --- diff --git a/network b/network index ef2064e7..c22b23f8 100755 --- 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