X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/d3abc2c9f5dc2d238c17bd8764f780b38cf58491..fd40fb97f848901b4d3c197d0e83e95b01312f9a:/package/base-files/default/sbin/wifi diff --git a/package/base-files/default/sbin/wifi b/package/base-files/default/sbin/wifi index c983fe0df..b228eed8a 100755 --- a/package/base-files/default/sbin/wifi +++ b/package/base-files/default/sbin/wifi @@ -1,4 +1,6 @@ #!/bin/sh +# Copyright (C) 2006 OpenWrt.org + . /etc/functions.sh config_get_bool() { @@ -28,20 +30,15 @@ config_cb() { } config_load wireless - -[ -d /lib/wifi -a -n "$(ls /lib/wifi/*.sh 2>&-)" ] && { - for script in /lib/wifi/*.sh; do - . $script - done -} +include wifi for device in $DEVICES; do ( - config_get type "$device" type - eval "type setup_$type 2>&- >&-" && { - eval "scan_$type '$device'" - eval "setup_$type '$device'" && { + config_get iftype "$device" type + eval "type setup_$iftype" 2>/dev/null >/dev/null && { + eval "scan_$iftype '$device'" + eval "setup_$iftype '$device'" && { # TODO: set up network settings /bin/true - } || echo "$device($type): Setup failed" || true - } || echo "$device($type): Interface type not supported" + } || echo "$device($iftype): Setup failed" || true + } || echo "$device($iftype): Interface type not supported" ); done