summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2013-03-29 12:05:01 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2013-03-29 12:05:01 +0100
commitbd491798a5e1e7db72996a85e734be78ce7976fd (patch)
treed7afe3f4b2eca73c381bcc998b5125c2cae567ce /src
parent11a2b4d455d5d996b78a3fa5f72b6728b470338f (diff)
downloadnetctl-bd491798a5e1e7db72996a85e734be78ce7976fd.tar.gz
netctl-bd491798a5e1e7db72996a85e734be78ce7976fd.tar.xz
Simplify wpa network block creation
It had grown a little diffuse.
Diffstat (limited to 'src')
-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"
}