]> git.ipfire.org Git - people/stevee/network.git/commitdiff
bridge: Show NO-CARRIER for ports instead of STP state.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 May 2012 13:35:09 +0000 (13:35 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 May 2012 13:35:09 +0000 (13:35 +0000)
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.

hooks/zones/bridge.ports/ethernet

index 7383dc47d1ab777a4896d06f0723274f1d5d067b..9fc1aa93856731823fe6aa381387dea72d6dc061 100755 (executable)
@@ -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}"