summaryrefslogtreecommitdiff
path: root/package/base-files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-03-24 13:42:53 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-03-24 13:42:53 +0000
commit2954f04b410cfb5e72ac6807717c58c06dfd07d4 (patch)
treed63279c7f09b3e955f9827fe02b099c86374a48a /package/base-files
parent535ff3f6b2edf6b21c10c584254459bf57fd0e8d (diff)
downloadmtk-20170518-2954f04b410cfb5e72ac6807717c58c06dfd07d4.zip
mtk-20170518-2954f04b410cfb5e72ac6807717c58c06dfd07d4.tar.gz
mtk-20170518-2954f04b410cfb5e72ac6807717c58c06dfd07d4.tar.bz2
small cleanup
SVN-Revision: 6663
Diffstat (limited to 'package/base-files')
-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 151036e..6e8e418 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";;