]> git.ipfire.org Git - people/ms/network.git/blobdiff - hooks/ports/ethernet
Create status output for ports.
[people/ms/network.git] / hooks / ports / ethernet
index 5647e45caa118c96652a92c64dfdc60fcec4d299..d74c2df5331d68ef5cead943a988cc7ca37bc9fd 100755 (executable)
@@ -77,45 +77,3 @@ function _hotplug_rename() {
        log DEBUG "Device '${device}' does not equal port '${port}'."
        exit ${EXIT_ERROR}
 }
-
-function _status() {
-       local port=${1}
-       shift
-
-       assert isset port
-
-       echo "${port}"
-
-       local status=$(device_get_status ${port})
-       printf "${DEVICE_PRINT_LINE1}" "Status:" "$(echo -ne ${STATUS_COLOUR[${status}]}${STATUS_TEXT[${status}]}${COLOUR_NORMAL})"
-
-       cli_headline "  Ethernet information:"
-       printf "${DEVICE_PRINT_LINE1}" "Address:" $(device_get_address ${port})
-       printf "${DEVICE_PRINT_LINE1}" "MTU:" $(device_get_mtu ${port})
-       printf "${DEVICE_PRINT_LINE1}" "Promisc mode:" $(device_is_promisc ${port} && echo "yes" || echo "no")
-
-       if device_is_bonded ${port}; then
-               cli_headline "  Bonding information:"
-
-               local master=$(bonding_slave_get_master ${port})
-               printf "${DEVICE_PRINT_LINE1}" "Master:" "${master}"
-
-               local active
-               if [ "$(bonding_get_active_slave ${master})" = "${port}" ]; then
-                       active="yes"
-               else
-                       active="no"
-               fi
-               printf "${DEVICE_PRINT_LINE1}" "Active slave:" "${active}"
-       fi
-
-       cli_headline "  Statistics:"
-       printf "${DEVICE_PRINT_LINE1}" "Received:" \
-               "$(beautify_bytes $(device_get_rx_bytes ${port})) ($(device_get_rx_packets ${port}) packets)"
-       printf "${DEVICE_PRINT_LINE1}" "Sent:" \
-               "$(beautify_bytes $(device_get_tx_bytes ${port})) ($(device_get_tx_packets ${port}) packets)"
-
-       echo
-
-       exit ${EXIT_OK}
-}