2006-10-05 04:05:48 +08:00
|
|
|
#!/bin/sh /etc/rc.common
|
2006-08-02 07:19:54 +08:00
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
2006-07-30 11:09:09 +08:00
|
|
|
|
2006-10-16 05:03:30 +08:00
|
|
|
START=40
|
2007-05-10 18:07:38 +08:00
|
|
|
STOP=40
|
|
|
|
|
2009-09-07 01:02:14 +08:00
|
|
|
config_cb() {
|
|
|
|
local cfg_type="$1"
|
|
|
|
|
|
|
|
case "$cfg_type" in
|
|
|
|
interface)
|
|
|
|
append networks "$2" "$N"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2007-03-02 21:21:33 +08:00
|
|
|
boot() {
|
2009-09-07 01:02:14 +08:00
|
|
|
uci_load network
|
2006-10-05 04:05:48 +08:00
|
|
|
setup_switch() { return 0; }
|
|
|
|
|
|
|
|
include /lib/network
|
|
|
|
setup_switch
|
2007-07-25 06:10:10 +08:00
|
|
|
[ -s /etc/config/wireless ] || \
|
2006-10-15 23:27:34 +08:00
|
|
|
/sbin/wifi detect > /etc/config/wireless
|
|
|
|
/sbin/wifi up
|
2009-09-07 01:02:14 +08:00
|
|
|
for network in $networks; do
|
|
|
|
config_get startupcheck $network started
|
|
|
|
[ "$startupcheck" = "" ] && ifup $network
|
|
|
|
done
|
2006-10-05 04:05:48 +08:00
|
|
|
}
|
2006-07-30 11:09:09 +08:00
|
|
|
|
2007-03-02 21:21:33 +08:00
|
|
|
start() {
|
|
|
|
ifup -a
|
|
|
|
/sbin/wifi up
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
2008-04-16 00:29:49 +08:00
|
|
|
setup_switch() { return 0; }
|
|
|
|
|
2008-04-12 22:57:47 +08:00
|
|
|
include /lib/network
|
2008-03-04 23:50:41 +08:00
|
|
|
setup_switch
|
2007-03-02 21:21:33 +08:00
|
|
|
ifup -a
|
|
|
|
/sbin/wifi up
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
ifdown -a
|
|
|
|
}
|