summaryrefslogtreecommitdiffstats
path: root/src/connections/wireless
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2009-09-22 15:12:07 +0200
committerJames Rayner <james@archlinux.org>2009-09-22 15:12:07 +0200
commit0bba84008f180097acf979cc2e87533c6e0bf2bd (patch)
tree5547168e7688e664b498c75121220cc1abdf1d5a /src/connections/wireless
parent978802d97fbcea7651597e4242be41d618100832 (diff)
downloadnetctl-0bba84008f180097acf979cc2e87533c6e0bf2bd.tar.gz
netctl-0bba84008f180097acf979cc2e87533c6e0bf2bd.tar.xz
Fix silly code
Diffstat (limited to 'src/connections/wireless')
-rw-r--r--src/connections/wireless31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/connections/wireless b/src/connections/wireless
index 9021edb..6e99952 100644
--- a/src/connections/wireless
+++ b/src/connections/wireless
@@ -156,24 +156,19 @@ wireless_up() {
;;
esac
- case $SECURITY in
- wep-old|none-old)
- true
- ;;
- *)
- [[ -z "$WPA_OPTS" ]] && WPA_OPTS="-Dwext"
- report_debug wireless_up start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS"
- if ! start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS"; then
- report_fail "wpa_supplicant did not start, possible configuration error"
- return 1
- fi
- report_debug wireless_up wpa_check
- if ! wpa_check "$INTERFACE" "$TIMEOUT"; then
- report_fail "WPA Authentication/Association Failed"
- return 1
- fi
- ;;
- esac
+ if [[ ${SECURITY:(-4)} != "-old" ]]; then
+ [[ -z "$WPA_OPTS" ]] && WPA_OPTS="-Dwext"
+ report_debug wireless_up start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS"
+ if ! start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS"; then
+ report_fail "wpa_supplicant did not start, possible configuration error"
+ return 1
+ fi
+ report_debug wireless_up wpa_check
+ if ! wpa_check "$INTERFACE" "$TIMEOUT"; then
+ report_fail "WPA Authentication/Association Failed"
+ return 1
+ fi
+ fi
if ! $CONN_DIR/ethernet up "$1"; then
wireless_down "$1" YES