netifd: sync with trunk r35251
[openwrt/svn-archive/archive.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 5
23
24 /sbin/wifi down
25 /sbin/wifi up
26 }
27
28 restart() {
29 ifdown -a
30 sleep 1
31 start
32 }
33
34 shutdown() {
35 ifdown -a
36 stop
37 }
38
39 stop() {
40 service_stop /sbin/netifd
41 }
42
43 reload() {
44 ubus call network reload
45 /sbin/wifi down
46 /sbin/wifi up
47 }