diff options
-rw-r--r-- | src/8021x | 4 | ||||
-rw-r--r-- | src/connections/wireless | 5 |
2 files changed, 7 insertions, 2 deletions
@@ -1,5 +1,3 @@ -WPA_CTRL_PATH=/run/wpa_supplicant - # Uses wpa_supplicant to check for association to a network # wpa_check interface [timeout] wpa_check() @@ -7,6 +5,7 @@ wpa_check() local timeout=0 INTERFACE="$1" TIMEOUT="${2:-15}" CONDITION="${3:-COMPLETED}" # CONDITION is required as wired connections are ready at ASSOCIATED not COMPLETED FS#20150 + report_debug wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status while [[ $timeout -lt "$TIMEOUT" ]]; do ( # Sometimes wpa_supplicant isn't ready so silence errors for 2s only to avoid hiding real errors if [[ $timeout -lt 2 ]]; then @@ -97,6 +96,7 @@ wpa_supplicant_scan_and_find() { # item = string to lookup local INTERFACE="$1" FIELD="$2" ITEM="$3" RETRIES=5 try scan_ok scan_ok=0 + report_debug wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan &> /dev/null for ((try=0; try < $RETRIES; try++)); do local found diff --git a/src/connections/wireless b/src/connections/wireless index 7f95c6f..e38a14f 100644 --- a/src/connections/wireless +++ b/src/connections/wireless @@ -26,8 +26,13 @@ wireless_up() { stop_wpa "$INTERFACE" # Start wpa_supplicant + WPA_CTRL_PATH=/run/wpa_supplicant if [ "$SECURITY" = "wpa-config" ]; then WPA_CONF="${WPA_CONF:-/etc/wpa_supplicant.conf}" + # Use defined control path (FS#24949) + if grep "ctrl_interface=" "$WPA_CONF" &>/dev/null; then + WPA_CTRL_PATH=$(grep "ctrl_interface=" "$WPA_CONF" | cut -d= -f 2- | sed -r 's/DIR=(.*) +GROUP=.*/\1/') + fi else WPA_CONF=$(make_wpa_config_file $INTERFACE) fi |