netifd: improve /sbin/ifup wifi hack, make it work properly with -a. fold /etc/init...
[openwrt/staging/chunkeey.git] / package / netifd / files / etc / init.d / network
1 #!/bin/sh /etc/rc.common
2
3 START=20
4 STOP=90
5
6 SERVICE_DAEMONIZE=1
7 SERVICE_WRITE_PID=1
8
9 start() {
10 stop
11 [ -e /proc/sys/kernel/core_pattern ] && {
12 ulimit -c unlimited
13 echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern
14 }
15 service_start /sbin/netifd
16
17 setup_switch() { return 0; }
18
19 include /lib/network
20 setup_switch
21
22 sleep 1
23 }
24
25 restart() {
26 ifdown -a
27 sleep 1
28 start
29 wifi
30 }
31
32 shutdown() {
33 ifdown -a
34 stop
35 }
36
37 stop() {
38 service_stop /sbin/netifd
39 }
40
41 reload() {
42 ubus call network reload
43 }