diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-03-24 13:42:53 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-03-24 13:42:53 +0000 |
commit | 7b76b0e987a430e5f4b30455297d782e4f0cd1b6 (patch) | |
tree | 5bdcd22941cab4ec4fb6087a9c57321eeb768dfd /package | |
parent | 0b1be07070670e5114ee06fcc2657ad7d7206459 (diff) | |
download | upstream-7b76b0e987a430e5f4b30455297d782e4f0cd1b6.tar.gz upstream-7b76b0e987a430e5f4b30455297d782e4f0cd1b6.tar.bz2 upstream-7b76b0e987a430e5f4b30455297d782e4f0cd1b6.zip |
small cleanup
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6663 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-x | package/base-files/files/sbin/wifi | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 151036e9cb..6e8e418458 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";; |