summaryrefslogtreecommitdiffstats
path: root/src/8021x
diff options
context:
space:
mode:
authorRémy Oudompheng <remy@archlinux.org>2011-06-19 19:12:27 +0200
committerRémy Oudompheng <remy@archlinux.org>2011-06-19 19:12:27 +0200
commita2e81ec74e0247a307cbdc36b6b2697650ca10c7 (patch)
tree2ecd395746b90dc3d15e04df27c41a30492af49b /src/8021x
parentb425d7737659bdc0758b2b759bf83a3ea34ba9ae (diff)
downloadnetctl-a2e81ec74e0247a307cbdc36b6b2697650ca10c7.tar.gz
netctl-a2e81ec74e0247a307cbdc36b6b2697650ca10c7.tar.xz
Replace iwgetid usage by wpa_cli.
Diffstat (limited to 'src/8021x')
-rw-r--r--src/8021x12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/8021x b/src/8021x
index a4a08ca..cbc8588 100644
--- a/src/8021x
+++ b/src/8021x
@@ -56,6 +56,18 @@ wpa_reconfigure() {
return $?
}
+wpa_check_current_essid() {
+ # usage: wpa_check_current_essid $interface $essid
+ # check that wpa_supplicant is connected to the right essid
+ local INTERFACE=$1 ESSID=$2 status
+ status=$($WPA_CLI -i "$INTERFACE" status | grep "^ssid=")
+ if (( $? == 0 )) && [[ "$status" == "ssid=$ESSID" ]]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
wpa_find_essid() {
# usage: wpa_find_essid $INTERFACE $ESSID
# look for existence of a given essid. Assumes wpa_supplicant is