From 0e9a81ff9450c86825b4a6d14c68ce4f12d4be0f Mon Sep 17 00:00:00 2001 From: Karthik Date: Wed, 13 Aug 2014 19:33:51 +0530 Subject: [PATCH] Give remedial suggestion for hostapd bug Hostapd v2 introduces a bug which currently throws the following error and initialization fails nl80211: Could not configure driver mode nl80211 driver initialization failed. hostapd_free_hapd_data: Interface wlp3s0ap wasn't started More Info: https://bugs.launchpad.net/ubuntu/+source/wpa/+bug/1289047 Give a suggestive message to the user when hostapd fails because of the above bug outlining the workaround mentioned in the above bug report. --- create_ap | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/create_ap b/create_ap index f8a9695..9a5d3f3 100755 --- a/create_ap +++ b/create_ap @@ -521,7 +521,13 @@ fi # start access point echo "hostapd command-line interface: hostapd_cli -p $CONFDIR/hostapd_ctrl" trap - SIGINT # reset trap -hostapd $CONFDIR/hostapd.conf || die "Failed to run hostapd, maybe a program is interfering." + +if ! hostapd $CONFDIR/hostapd.conf; then + echo -e "\nError: Failed to run hostapd, maybe a program is interfering." + echo -e "\nIf an error like 'n80211: Could not configure driver mode' was thrown, it is probably becasue of a bug in hostapd." + echo "Try running 'nmcli nm wifi off; rfkill unblock wlan' before starting create_ap." + die +fi cleanup exit 0