]> git.ipfire.org Git - people/arne_f/network.git/blobdiff - functions.ports
network: STP: Make protocol version configureable.
[people/arne_f/network.git] / functions.ports
index d0d7dee62398c0ad7d6717351adb3c22966b24fc..6c59578dedc017232aafc6047914d63c34c6e5f5 100644 (file)
@@ -142,3 +142,19 @@ function ports_get() {
                fi
        done
 }
+
+# This function automatically creates the real ethernet devices
+# that do not exists in the configuration.
+# Saves some work for the administrator.
+function ports_init() {
+       local device
+       for device in $(devices_get_all); do
+               if device_is_real ${device}; then
+                       if ! port_exists ${device}; then
+                               port_create ethernet ${device}
+                       fi
+               fi
+       done
+}
+
+init_register ports_init