2006-10-04 20:05:48 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2011-03-15 00:44:15 +00:00
|
|
|
# Copyright (C) 2006-2011 OpenWrt.org
|
2006-07-30 03:09:09 +00:00
|
|
|
|
2006-10-15 21:03:30 +00:00
|
|
|
START=40
|
2010-01-30 18:17:48 +00:00
|
|
|
STOP=90
|
2007-05-10 10:07:38 +00:00
|
|
|
|
2007-03-02 13:21:33 +00:00
|
|
|
boot() {
|
2006-10-04 20:05:48 +00:00
|
|
|
setup_switch() { return 0; }
|
|
|
|
|
|
|
|
include /lib/network
|
|
|
|
setup_switch
|
2011-06-07 17:00:43 +00:00
|
|
|
|
|
|
|
/sbin/wifi detect > /tmp/wireless.tmp
|
|
|
|
[ -s /tmp/wireless.tmp ] && {
|
|
|
|
cat /tmp/wireless.tmp >> /etc/config/wireless
|
|
|
|
}
|
|
|
|
rm -f /tmp/wireless.tmp
|
2010-04-03 13:31:59 +00:00
|
|
|
grep -qs config /etc/config/wireless && {
|
|
|
|
/sbin/wifi up
|
|
|
|
}
|
2010-05-06 19:50:22 +00:00
|
|
|
|
|
|
|
scan_interfaces
|
|
|
|
|
|
|
|
local ifc
|
|
|
|
for ifc in $interfaces; do
|
|
|
|
local proto
|
|
|
|
config_get proto "$ifc" proto
|
|
|
|
|
2010-05-27 23:04:56 +00:00
|
|
|
local auto
|
|
|
|
config_get_bool auto "$ifc" auto 1
|
|
|
|
|
|
|
|
type "coldplug_interface_$proto" >/dev/null && [ "$auto" = 1 ] && \
|
2010-05-06 19:50:22 +00:00
|
|
|
coldplug_interface_$proto "$ifc"
|
|
|
|
done
|
2006-10-04 20:05:48 +00:00
|
|
|
}
|
2006-07-30 03:09:09 +00:00
|
|
|
|
2007-03-02 13:21:33 +00:00
|
|
|
start() {
|
2008-04-15 16:29:49 +00:00
|
|
|
setup_switch() { return 0; }
|
|
|
|
|
2008-04-12 14:57:47 +00:00
|
|
|
include /lib/network
|
2008-03-04 15:50:41 +00:00
|
|
|
setup_switch
|
2007-03-02 13:21:33 +00:00
|
|
|
ifup -a
|
|
|
|
/sbin/wifi up
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
ifdown -a
|
|
|
|
}
|
2010-03-15 14:02:49 +00:00
|
|
|
|
|
|
|
restart() {
|
|
|
|
start
|
|
|
|
}
|