summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-08-28 12:13:36 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-08-28 12:13:36 +0000
commita9a07e375b798688dfe9d693577106a0c32b30c8 (patch)
tree6852d5f6f0ded2c5e2002e9229cacd63873b0c3c /package
parent305106cae5c7319321448aeeb6e1246835d7a43b (diff)
madwifi: only start hostapd when necessary
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12420 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-xpackage/madwifi/files/lib/wifi/madwifi.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh
index cc340977b..0b2488690 100755
--- a/package/madwifi/files/lib/wifi/madwifi.sh
+++ b/package/madwifi/files/lib/wifi/madwifi.sh
@@ -78,6 +78,7 @@ enable_atheros() {
local first=1
for vif in $vifs; do
+ local start_hostapd
nosbeacon=
config_get ifname "$vif" ifname
config_get enc "$vif" encryption
@@ -137,7 +138,6 @@ enable_atheros() {
[ -n "$wdssep" ] && iwpriv "$ifname" wdssep "$wdssep"
}
- wpa=
case "$enc" in
WEP|wep)
for idx in 1 2 3 4; do
@@ -152,6 +152,7 @@ enable_atheros() {
esac
;;
PSK|psk|PSK2|psk2)
+ start_hostapd=1
config_get key "$vif" key
;;
esac
@@ -261,7 +262,7 @@ enable_atheros() {
config_get_bool isolate "$vif" isolate 0
iwpriv "$ifname" ap_bridge "$((isolate^1))"
- if eval "type hostapd_setup_vif" 2>/dev/null >/dev/null; then
+ if [ -n "$start_hostapd" ] && eval "type hostapd_setup_vif" 2>/dev/null >/dev/null; then
hostapd_setup_vif "$vif" madwifi || {
echo "enable_atheros($device): Failed to set up hostapd for interface $ifname" >&2
# make sure this wifi interface won't accidentally stay open without encryption