diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-07-05 13:17:13 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-07-05 13:17:13 +0200 |
commit | 0f5eb3ef064c4a62a5ba3c8f4733f8e61556687b (patch) | |
tree | d3149db9fdc1a9513a169f8877291992e0581d78 /src/connections | |
parent | c2036ac1ab643040d6cf98e682ed171114d87090 (diff) | |
download | netctl-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')
-rw-r--r-- | src/connections/ethernet | 6 | ||||
-rw-r--r-- | src/connections/wireless | 12 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/connections/ethernet b/src/connections/ethernet index b33dfbd..ba6c7be 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -43,11 +43,6 @@ ethernet_up() { . "$SUBR_DIR/8021x" [[ -z "$WPA_CONF" ]] && WPA_CONF="/etc/wpa_supplicant.conf" [[ -z "$WPA_DRIVER" ]] && WPA_DRIVER="wired" - # Set wpa_supplicant control path (FS#25473) - WPA_CTRL_PATH=/run/wpa_supplicant - 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 report_debug ethernet_up start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_DRIVER" "$WPA_OPTS" if ! start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_DRIVER" "$WPA_OPTS"; then @@ -276,6 +271,7 @@ ethernet_status() { stop_80211x() { if checkyesno "${AUTH8021X:-no}"; then . "$SUBR_DIR/8021x" + [[ -z "$WPA_CONF" ]] && WPA_CONF="/etc/wpa_supplicant.conf" report_debug ethernet_down stop_wpa "$INTERFACE" stop_wpa "$INTERFACE" fi 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" |