summaryrefslogtreecommitdiffstats
path: root/src/connections/wireless
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-07-05 13:17:13 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2012-07-05 13:17:13 +0200
commit0f5eb3ef064c4a62a5ba3c8f4733f8e61556687b (patch)
treed3149db9fdc1a9513a169f8877291992e0581d78 /src/connections/wireless
parentc2036ac1ab643040d6cf98e682ed171114d87090 (diff)
downloadnetctl-0f5eb3ef064c4a62a5ba3c8f4733f8e61556687b.tar.gz
netctl-0f5eb3ef064c4a62a5ba3c8f4733f8e61556687b.tar.xz
Rethink management of socket location for wpa_supplicant
This may be set in a custom supplicant configuration file. All this is needed to cater for that. The new name of the tracking variable is WPA_CTRL_DIR, conform the environment variable of wpa_cli -a.
Diffstat (limited to 'src/connections/wireless')
-rw-r--r--src/connections/wireless12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/connections/wireless b/src/connections/wireless
index 0389ea6..e0321d4 100644
--- a/src/connections/wireless
+++ b/src/connections/wireless
@@ -8,7 +8,6 @@ wireless_up() {
load_profile "$PROFILE"
# Default settings
- WPA_CTRL_PATH=/run/wpa_supplicant
SECURITY=${SECURITY:-none}
WPA_DRIVER=${WPA_DRIVER:-nl80211,wext}
@@ -18,16 +17,11 @@ wireless_up() {
is_interface "$INTERFACE" || { report_fail "interface $INTERFACE does not exist"; return 1; }
# Kill any lingering wpa_supplicants.
- report_debug wireless_up stop_wpa "$INTERFACE"
- stop_wpa "$INTERFACE"
+ stop_wpa "$INTERFACE" &> /dev/null
# Start wpa_supplicant
if [[ "$SECURITY" = "wpa-config" ]]; then
WPA_CONF="${WPA_CONF:-/etc/wpa_supplicant.conf}"
- # Use defined control path (FS#24949)
- if grep -q "^ *ctrl_interface=" "$WPA_CONF"; then
- WPA_CTRL_PATH=$(grep -m 1 "^ *ctrl_interface=" "$WPA_CONF" | cut -d= -f 2- | sed -r 's/^DIR=(.*) GROUP=.*/\1/')
- fi
else
WPA_CONF=$(make_wpa_config_file $INTERFACE)
fi
@@ -98,6 +92,10 @@ wireless_down() {
"$CONN_DIR/ethernet" down "$PROFILE"
+ # The config file can contain a non-standard control socket path
+ if [[ "$SECURITY" = "wpa-config" ]]; then
+ WPA_CONF="${WPA_CONF:-/etc/wpa_supplicant.conf}"
+ fi
report_debug wireless_down stop_wpa "$INTERFACE"
stop_wpa "$INTERFACE"
rm -rf "$STATE_DIR/wpa.$INTERFACE"