diff options
author | Rémy Oudompheng <remy@archlinux.org> | 2011-06-11 23:38:26 +0200 |
---|---|---|
committer | Rémy Oudompheng <remy@archlinux.org> | 2011-06-11 23:38:26 +0200 |
commit | 757e5d909c9f41a653ee6d3a6b21da2aa6ea766d (patch) | |
tree | 4e252de848c00d16a6409ed8ae435b8b11101a2e /src | |
parent | 2d0c4fb52357dd13d927d7c6d571643e95d5e59c (diff) | |
download | netctl-757e5d909c9f41a653ee6d3a6b21da2aa6ea766d.tar.gz netctl-757e5d909c9f41a653ee6d3a6b21da2aa6ea766d.tar.xz |
wireless: add proper option to wpa_cli to find files in /run
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/8021x | 6 | ||||
-rw-r--r-- | src/wireless | 4 |
2 files changed, 5 insertions, 5 deletions
@@ -8,9 +8,9 @@ wpa_check() 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 - eval $(wpa_cli -i "$INTERFACE" status 2> /dev/null | fgrep "wpa_state=") + eval $(wpa_cli -p /run/wpa_supplicant -i "$INTERFACE" status 2> /dev/null | fgrep "wpa_state=") else - eval $(wpa_cli -i "$INTERFACE" status | fgrep "wpa_state=") + eval $(wpa_cli -p /run/wpa_supplicant -i "$INTERFACE" status | fgrep "wpa_state=") fi [[ "$wpa_state" = "$CONDITION" ]] ) && return 0 @@ -40,7 +40,7 @@ start_wpa() stop_wpa() { - wpa_cli -i "$1" terminate &> /dev/null + wpa_cli -p /run/wpa_supplicant -i "$1" terminate &> /dev/null sleep 1 # JP: need this else the file tends to disappear after [[ -f ... ]] but before cat... # see <http://bbs.archlinux.org/viewtopic.php?pid=515667#p515667> if [[ -f "/run/wpa_supplicant_$1.pid" ]]; then diff --git a/src/wireless b/src/wireless index 8a75d68..71713e7 100644 --- a/src/wireless +++ b/src/wireless @@ -87,9 +87,9 @@ wpa_supplicant_scan_info() { essids=$(mktemp --tmpdir essid.XXXXXXXX) wpa_supplicant -B -i"$INTERFACE" -Dnl80211,wext -C/run/wpa_supplicant -P/run/wpa_supplicant.pid || return 1 - wpa_cli -i "$INTERFACE" scan &> /dev/null + wpa_cli -p /run/wpa_supplicant -i "$INTERFACE" scan &> /dev/null sleep 2.5 - wpa_cli -i "$INTERFACE" scan_results | + wpa_cli -p /run/wpa_supplicant -i "$INTERFACE" scan_results | grep -v "^Selected" | grep -v "^bssid" | sort -rn -k3 | |