From: Michael Tremer Date: Sun, 27 May 2012 13:35:09 +0000 (+0000) Subject: bridge: Show NO-CARRIER for ports instead of STP state. X-Git-Tag: 004~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7fdca09480a1c276ab9247cfd5b2a8560eaefd53;p=network.git bridge: Show NO-CARRIER for ports instead of STP state. However, it is not very clear why a certain port has got that status. NO-CARRIER implies that the device is unplugged or the link is just down. --- diff --git a/hooks/zones/bridge.ports/ethernet b/hooks/zones/bridge.ports/ethernet index 7383dc47..9fc1aa93 100755 --- a/hooks/zones/bridge.ports/ethernet +++ b/hooks/zones/bridge.ports/ethernet @@ -138,6 +138,8 @@ function _status() { printf " %-10s - " "${port}" if ! device_is_up ${port}; then echo -ne "${COLOUR_DOWN} DOWN ${COLOUR_NORMAL}" + elif ! device_has_carrier ${port}; then + echo -ne "${COLOUR_DOWN}NO-CARRIER${COLOUR_NORMAL}" elif [ -n "$(stp_bridge_get_protocol ${zone})" ]; then local state=$(stp_port_get_state ${zone} ${port}) local colour="COLOUR_STP_${state}"