]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/network
Remove remains of the "real" device type
[people/stevee/network.git] / src / network
index 1999c3d5dc62b874114805989b2c3dd2e8419647..81bb3bb540b69354ac6d19893f084afee26e8575 100644 (file)
@@ -128,6 +128,11 @@ function cli_device_status() {
 
        cli_print_fmt1 1 "Status"       "${status}"
        cli_print_fmt1 1 "Type"         "${type}"
+
+       # Ethernet-compatible?
+       device_is_ethernet_compatible "${device}" &>/dev/null
+       cli_print_fmt1 1 "Ethernet-compatible" "$(cli_print_bool $?)"
+
        cli_print_fmt1 1 "Address"      "$(device_get_address ${device})"
        cli_space
 
@@ -234,8 +239,8 @@ function cli_device_discover() {
        local device=${1}
        shift
 
-       local device_type=$(device_get_type ${device})
-       if [ "${device_type}" != "real" ]; then
+       # This can only be executed for ethernet (or compatible) devices
+       if ! device_is_ethernet_compatible "${device}"; then
                return ${EXIT_OK}
        fi
 
@@ -468,22 +473,9 @@ function cli_port() {
                action=${2}
                shift 2
 
-               # Action aliases
-               case "${action}" in
-                       start)
-                               action="up"
-                               ;;
-                       stop)
-                               action="down"
-                               ;;
-                       show)
-                               action="status"
-                               ;;
-               esac
-
                case "${action}" in
-                       edit|up|down|status)
-                               port_${action} ${port} $@
+                       edit|create|remove|up|down|status)
+                               port_${action} "${port}" $@
                                ;;
                        *)
                                error "Unrecognized argument: ${action}"
@@ -495,7 +487,7 @@ function cli_port() {
                shift
 
                case "${action}" in
-                       create|destroy)
+                       new|destroy)
                                port_${action} $@
                                ;;
                        *)
@@ -1053,7 +1045,7 @@ function cli_reset() {
 
        local port
        for port in $(ports_get --all); do
-               port_remove ${port}
+               port_destroy "${port}"
        done
 
        # Flush all DNS servers.