summaryrefslogtreecommitdiffstats
path: root/src/8021x
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2009-09-22 15:04:15 +0200
committerJames Rayner <james@archlinux.org>2009-09-22 15:04:15 +0200
commit978802d97fbcea7651597e4242be41d618100832 (patch)
tree0d3cf50e099bea65eede503ed0b852e65ffa5a28 /src/8021x
parent1c6760ebd6b7d6630fbab75885fac5dbea90c78b (diff)
downloadnetctl-978802d97fbcea7651597e4242be41d618100832.tar.gz
netctl-978802d97fbcea7651597e4242be41d618100832.tar.xz
Rework wireless to use wpa_supplicant more, add CONFIGSECTION support
CONFIGSECTION will be useful later on for integration with autowifi. It'll allow WPA configurations to be stored _in_ the profile, rather than separately. Experimentally, WEP/none support has been migrated to wpa_supplicant. Support for string keys has not yet been merged.
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 5d5e211..f18b83f 100644
--- a/src/8021x
+++ b/src/8021x
@@ -47,4 +47,16 @@ stop_wpa()
fi
}
+# $1 is profile
+make_wpa_config() {
+ local WPA_CONF="${TMPDIR:-/tmp}/wpa.${1// /}" # substitute spaces out
+ # make empty tmp dir with correct permissions, rename it
+ rm -rf "$WPA_CONF"
+ mv -f "$(mktemp -d)" "$WPA_CONF" || return 1
+ echo "ctrl_interface=/var/run/wpa_supplicant" >> "$WPA_CONF/wpa.conf" # we know $WPA_CONF now has no spaces, but it may have other nasty chars, so still needs to be quoted
+ echo "ctrl_interface_group=${WPA_GROUP:-wheel}" >> "$WPA_CONF/wpa.conf"
+ echo "$WPA_CONF/wpa.conf"
+}
+
# vim: ft=sh ts=4 et sw=4:
+