summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2013-03-29 12:05:01 +0100
committerRobbie Smith <zoqaeski@gmail.com>2013-04-08 06:43:55 +0200
commit5446a009aa33f53d58ee2dfb099ea1edcc877036 (patch)
tree272b7c8e4955bcdb319a7517e001eb9e2016920a
parent754a4c1094338bec4b07abe06948ac51843b07ca (diff)
downloadnetctl-5446a009aa33f53d58ee2dfb099ea1edcc877036.tar.gz
netctl-5446a009aa33f53d58ee2dfb099ea1edcc877036.tar.xz
Simplify wpa network block creation
It had grown a little diffuse.
-rw-r--r--src/lib/8021x31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/lib/8021x b/src/lib/8021x
index 7a841a4..65ef8f9 100644
--- a/src/lib/8021x
+++ b/src/lib/8021x
@@ -196,23 +196,6 @@ wpa_make_config_file() {
# $Security: type of wireless security
wpa_make_config_block() {
case $Security in
- none|wep|wpa)
- echo "ssid=$(wpa_quote "$ESSID")"
- [[ $AP ]] && echo "bssid=${AP,,}"
- is_yes "${AdHoc:-no}" && echo "mode=1"
- ;;
- wpa-configsection)
- printf "%s\n" "${WPAConfigSection[@]}"
- return
- ;;
- *)
- report_error "Unsupported security setting: '$Security'"
- return 1
- ;;
- esac
-
- # Key management
- case $Security in
none)
echo "key_mgmt=NONE"
;;
@@ -229,12 +212,20 @@ wpa_make_config_block() {
echo "psk=$(wpa_quote "$Key")"
fi
;;
+ wpa-configsection)
+ printf "%s\n" "${WPAConfigSection[@]}"
+ return
+ ;;
+ *)
+ report_error "Unsupported security setting: '$Security'"
+ return 1
+ ;;
esac
- # Hidden SSID
+ echo "ssid=$(wpa_quote "$ESSID")"
+ [[ $AP ]] && echo "bssid=${AP,,}"
is_yes "${Hidden:-no}" && echo "scan_ssid=1"
-
- # Priority group for the network
+ is_yes "${AdHoc:-no}" && echo "mode=1"
[[ $Priority ]] && echo "priority=$Priority"
}