aboutsummaryrefslogtreecommitdiffstats
path: root/package/madwifi/files/lib/wifi
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-04-19 11:42:39 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-04-19 11:42:39 +0000
commit4062525157223464b36ee9757dd1e025d2202ccd (patch)
treeb071683ad0c6d7237ddac5ac2be1a107faef6acd /package/madwifi/files/lib/wifi
parent1099e2d679328043c2c317169054f16a86b5d45b (diff)
downloadupstream-4062525157223464b36ee9757dd1e025d2202ccd.tar.gz
upstream-4062525157223464b36ee9757dd1e025d2202ccd.tar.bz2
upstream-4062525157223464b36ee9757dd1e025d2202ccd.zip
don't try to set up wpa if hostapd is not installed
SVN-Revision: 7005
Diffstat (limited to 'package/madwifi/files/lib/wifi')
-rwxr-xr-xpackage/madwifi/files/lib/wifi/madwifi.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh
index 15e7850eb9..69874b5c18 100755
--- a/package/madwifi/files/lib/wifi/madwifi.sh
+++ b/package/madwifi/files/lib/wifi/madwifi.sh
@@ -194,13 +194,15 @@ enable_atheros() {
iwconfig "$ifname" essid "$ssid"
case "$mode" in
ap)
- hostapd_setup_vif "$vif" madwifi || {
- echo "enable_atheros($device): Failed to set up wpa for interface $ifname" >&2
- # make sure this wifi interface won't accidentally stay open without encryption
- ifconfig "$ifname" down
- wlanconfig "$ifname" destroy
- continue
- }
+ if eval "type hostapd_setup_vif" 2>/dev/null >/dev/null; then
+ hostapd_setup_vif "$vif" madwifi || {
+ echo "enable_atheros($device): Failed to set up wpa for interface $ifname" >&2
+ # make sure this wifi interface won't accidentally stay open without encryption
+ ifconfig "$ifname" down
+ wlanconfig "$ifname" destroy
+ continue
+ }
+ fi
;;
wds|sta)
case "$enc" in