don't try to set up wpa if hostapd is not installed
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 19 Apr 2007 11:42:39 +0000 (11:42 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 19 Apr 2007 11:42:39 +0000 (11:42 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7005 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/madwifi/files/lib/wifi/madwifi.sh

index 15e7850..69874b5 100755 (executable)
@@ -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 
This page took 0.027448 seconds and 4 git commands to generate.