From 2e0232ccf156498b81c06044890e59fb4a6b7943 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Sun, 13 Sep 2009 23:43:38 -0400 Subject: Returns and exits * add some abortive returns * some exit tweaks Signed-off-by: Jim Pryor --- src/connections/wireless | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/connections') diff --git a/src/connections/wireless b/src/connections/wireless index 0e7e274..955f957 100644 --- a/src/connections/wireless +++ b/src/connections/wireless @@ -11,12 +11,14 @@ wireless_up() { . "$SUBR_DIR/wireless" if [[ -n "$RFKILL" ]]; then - if [[ ! "$(get_rf_state "$INTERFACE")" == "up" ]]; then + local state=$(get_rf_state "$INTERFACE") || return 1 + if [[ "$state" != "up" ]]; then if [[ "$RFKILL" == "soft" ]]; then set_rf_state "$INTERFACE" up sleep 1 else report_fail "radio is disabled on $INTERFACE" + return 1 fi fi fi @@ -218,7 +220,7 @@ wireless_down() { # Any reason why a hardware switch should be considered on interface down? if [[ "$RFKILL" == "soft" ]]; then . "$SUBR_DIR/wireless" - set_rf_state "$INTERFACE" down + set_rf_state "$INTERFACE" down || return 1 fi } -- cgit v1.2.3-24-g4f1b