summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-03-24 13:42:53 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-03-24 13:42:53 +0000
commit1addd4cc9c4dd7605c9d3e6ed550b229dc6ebe05 (patch)
tree5bdcd22941cab4ec4fb6087a9c57321eeb768dfd
parent9910132d53a7f2b5ab8f2933c052c1f8d21dedca (diff)
small cleanup
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6663 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-xpackage/base-files/files/sbin/wifi32
1 files changed, 18 insertions, 14 deletions
diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi
index 151036e9c..6e8e41845 100755
--- a/package/base-files/files/sbin/wifi
+++ b/package/base-files/files/sbin/wifi
@@ -71,25 +71,29 @@ start_net() {(
setup_interface "$1" "$2"
)}
-config_cb() {
- config_get TYPE "$CONFIG_SECTION" TYPE
- case "$TYPE" in
- wifi-device)
- append DEVICES "$CONFIG_SECTION"
- ;;
- wifi-iface)
- config_get device "$CONFIG_SECTION" device
- config_get vifs "$device" vifs
- append vifs "$CONFIG_SECTION"
- config_set "$device" vifs "$vifs"
- ;;
- esac
+scan_wifi() {
+ local cfgfile="$1"
+ config_cb() {
+ config_get TYPE "$CONFIG_SECTION" TYPE
+ case "$TYPE" in
+ wifi-device)
+ append DEVICES "$CONFIG_SECTION"
+ ;;
+ wifi-iface)
+ config_get device "$CONFIG_SECTION" device
+ config_get vifs "$device" vifs
+ append vifs "$CONFIG_SECTION"
+ config_set "$device" vifs "$vifs"
+ ;;
+ esac
+ }
+ config_load "${cfgfile:-wireless}"
}
DEVICES=
DRIVERS=
-config_load wireless
include /lib/wifi
+scan_wifi
case "$1" in
down) wifi_updown "disable" "$2";;