base-files: add support for the usbdev LED trigger
[openwrt/svn-archive/archive.git] / package / base-files / files / etc / init.d / network
index 3587c24aaa87e50cd46ab158f39c9e2f99d5e6c9..9d4904ae4301d14f1dcc38b3bcf5011914c2d560 100755 (executable)
@@ -9,9 +9,26 @@ boot() {
 
        include /lib/network
        setup_switch
-       [ -s /etc/config/wireless ] || \
+       grep -qs config /etc/config/wireless && {
+               /sbin/wifi up
+       } || {
+               rm -f /etc/config/wireless
                /sbin/wifi detect > /etc/config/wireless
-       /sbin/wifi up
+       }
+
+       scan_interfaces
+
+       local ifc
+       for ifc in $interfaces; do
+               local proto
+               config_get proto "$ifc" proto
+
+               local auto
+               config_get_bool auto "$ifc" auto 1
+
+               type "coldplug_interface_$proto" >/dev/null && [ "$auto" = 1 ] && \
+                       coldplug_interface_$proto "$ifc"
+       done
 }
 
 start() {