summaryrefslogtreecommitdiffstats
path: root/src/connections
diff options
context:
space:
mode:
authorRémy Oudompheng <remy@archlinux.org>2011-07-30 20:57:29 +0200
committerRémy Oudompheng <remy@archlinux.org>2011-07-30 20:57:29 +0200
commita1fc17107a833d0a55bca8b14d3244b7788adf86 (patch)
treeb5082b7eaeb2f6b8f784a586217099ada69196d9 /src/connections
parent20603a6e06f16b82267fac9c8cd90d0113b36e92 (diff)
downloadnetctl-a1fc17107a833d0a55bca8b14d3244b7788adf86.tar.gz
netctl-a1fc17107a833d0a55bca8b14d3244b7788adf86.tar.xz
Use configured control path for wpa_supplicant (FS#24949)
Otherwise the wpa_cli calls may fail if the specified ctrl_interface directory differs from the default one. Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
Diffstat (limited to 'src/connections')
-rw-r--r--src/connections/wireless5
1 files changed, 5 insertions, 0 deletions
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