summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRémy Oudompheng <remy@archlinux.org>2011-06-19 16:41:02 +0200
committerRémy Oudompheng <remy@archlinux.org>2011-06-19 18:49:26 +0200
commit00c0b8e7b685057d6a5ff9ee2f9e74dd79470d60 (patch)
tree566319fdbf0eaab5537a03c2509d4797a41423ef /src
parent399e423725903921ce348fd067d8d57e63198766 (diff)
downloadnetctl-00c0b8e7b685057d6a5ff9ee2f9e74dd79470d60.tar.gz
netctl-00c0b8e7b685057d6a5ff9ee2f9e74dd79470d60.tar.xz
Hold wpa_cli command line common arguments in $WPA_CLI
Diffstat (limited to 'src')
-rw-r--r--src/8021x8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/8021x b/src/8021x
index d5756a2..fea7c39 100644
--- a/src/8021x
+++ b/src/8021x
@@ -1,3 +1,5 @@
+WPA_CLI="wpa_cli -p /run/wpa_supplicant"
+
# Uses wpa_supplicant to check for association to a network
# wpa_check interface [timeout]
wpa_check()
@@ -8,9 +10,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 -p /run/wpa_supplicant -i "$INTERFACE" status 2> /dev/null | fgrep "wpa_state=")
+ eval $($WPA_CLI -i "$INTERFACE" status 2> /dev/null | fgrep "wpa_state=")
else
- eval $(wpa_cli -p /run/wpa_supplicant -i "$INTERFACE" status | fgrep "wpa_state=")
+ eval $($WPA_CLI -i "$INTERFACE" status | fgrep "wpa_state=")
fi
[[ "$wpa_state" = "$CONDITION" ]]
) && return 0
@@ -40,7 +42,7 @@ start_wpa()
stop_wpa()
{
- wpa_cli -p /run/wpa_supplicant -i "$1" terminate &> /dev/null
+ $WPA_CLI -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