[package] base-files: add a coldplug_interface_* hook to bring up non-hotpluggable...
[openwrt.git] / package / base-files / files / etc / init.d / network
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 START=40
5 STOP=90
6
7 boot() {
8 setup_switch() { return 0; }
9
10 include /lib/network
11 setup_switch
12 grep -qs config /etc/config/wireless && {
13 /sbin/wifi up
14 } || {
15 rm -f /etc/config/wireless
16 /sbin/wifi detect > /etc/config/wireless
17 }
18
19 scan_interfaces
20
21 local ifc
22 for ifc in $interfaces; do
23 local proto
24 config_get proto "$ifc" proto
25
26 type "coldplug_interface_$proto" >/dev/null && \
27 coldplug_interface_$proto "$ifc"
28 done
29 }
30
31 start() {
32 setup_switch() { return 0; }
33
34 include /lib/network
35 setup_switch
36 ifup -a
37 /sbin/wifi up
38 }
39
40 stop() {
41 ifdown -a
42 }
43
44 restart() {
45 start
46 }
This page took 0.046848 seconds and 5 git commands to generate.