add support for if{down,up} -a and implement proper start/stop/restart for /etc/init...
[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 boot() {
6         setup_switch() { return 0; }
7
8         include /lib/network
9         setup_switch
10         [ -e /etc/config/wireless ] || \
11                 /sbin/wifi detect > /etc/config/wireless
12         /sbin/wifi up
13 }
14
15 start() {
16         ifup -a
17         /sbin/wifi up
18 }
19
20 restart() {
21         ifup -a
22         /sbin/wifi up
23 }
24
25 stop() {
26         ifdown -a
27 }