From: Felix Fietkau Date: Thu, 19 Apr 2007 11:42:39 +0000 (+0000) Subject: don't try to set up wpa if hostapd is not installed X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4062525157223464b36ee9757dd1e025d2202ccd;p=openwrt%2Fstaging%2Frobimarko.git don't try to set up wpa if hostapd is not installed SVN-Revision: 7005 --- 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