[package] base-files: add a coldplug_interface_* hook to bring up non-hotpluggable...
[openwrt.git] / package / base-files / files / etc / init.d / network
index 74478c7..d60d41a 100755 (executable)
@@ -9,17 +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
-}
+       }
 
-start() {
-       ifup -a
-       /sbin/wifi up
+       scan_interfaces
+
+       local ifc
+       for ifc in $interfaces; do
+               local proto
+               config_get proto "$ifc" proto
+
+               type "coldplug_interface_$proto" >/dev/null && \
+                       coldplug_interface_$proto "$ifc"
+       done
 }
 
-restart() {
+start() {
        setup_switch() { return 0; }
        
        include /lib/network
@@ -31,3 +40,7 @@ restart() {
 stop() {
        ifdown -a
 }
+
+restart() {
+       start
+}
This page took 0.022377 seconds and 4 git commands to generate.