From 0bba84008f180097acf979cc2e87533c6e0bf2bd Mon Sep 17 00:00:00 2001 From: James Rayner Date: Tue, 22 Sep 2009 23:12:07 +1000 Subject: Fix silly code --- src/connections/wireless | 31 +++++++++++++------------------ 1 file 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 -- cgit v1.2.3-24-g4f1b