diff options
author | Jim Pryor <profjim@jimpryor.net> | 2009-09-14 05:43:38 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2009-09-14 08:23:56 +0200 |
commit | 2e0232ccf156498b81c06044890e59fb4a6b7943 (patch) | |
tree | eb9a2fd1fc0f0b1a7d0797179368ed42b3d6db80 /src/connections | |
parent | deed4d3d3cff0fa45d0d0d5aa665db102cdc5ff3 (diff) | |
download | netctl-2e0232ccf156498b81c06044890e59fb4a6b7943.tar.gz netctl-2e0232ccf156498b81c06044890e59fb4a6b7943.tar.xz |
Returns and exits
* add some abortive returns
* some exit tweaks
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src/connections')
-rw-r--r-- | src/connections/wireless | 6 |
1 files changed, 4 insertions, 2 deletions
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 } |