diff options
author | Jim Pryor <profjim@jimpryor.net> | 2009-09-14 05:43:34 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2009-09-14 08:22:11 +0200 |
commit | 67f1b8fae53ebe22ad1a0557c0d7a1371b96cb0b (patch) | |
tree | 76a0ad11c1df8272d0815a9c6c8398953f4effa0 /src/connections | |
parent | 820d9295b51e427f3e17c9e83227a127ef9b7631 (diff) | |
download | netctl-67f1b8fae53ebe22ad1a0557c0d7a1371b96cb0b.tar.gz netctl-67f1b8fae53ebe22ad1a0557c0d7a1371b96cb0b.tar.xz |
Tweaks while merging
* added various quotes
* made some vars local
* tweaked some [[ ]]s, including one broken one in netcfg-menu
* s/ra0/$INTERFACE/ in ethernet-iproute and wireless
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src/connections')
-rw-r--r-- | src/connections/ethernet-iproute | 2 | ||||
-rw-r--r-- | src/connections/wireless | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/connections/ethernet-iproute b/src/connections/ethernet-iproute index b86b9f4..855ddb6 100644 --- a/src/connections/ethernet-iproute +++ b/src/connections/ethernet-iproute @@ -128,7 +128,7 @@ ethernet_down() { # Returns status of profile - is it still functional? ethernet_status() { - if ! ip link show dev ra0 | fgrep -q "state UP"; then + if ! ip link show dev "$INTERFACE" | fgrep -q "state UP"; then return 1 fi } diff --git a/src/connections/wireless b/src/connections/wireless index 29e4112..b923b0b 100644 --- a/src/connections/wireless +++ b/src/connections/wireless @@ -10,10 +10,10 @@ wireless_up() { . "$SUBR_DIR/8021x" . "$SUBR_DIR/wireless" - if [[ $RFKILL ]]; then - if [[ ! $(get_rf_state $INTERFACE) == "up" ]]; then - if [[ $RFKILL == "soft" ]]; then - set_rf_state $INTERFACE up + if [[ -n "$RFKILL" ]]; then + if [[ ! "$(get_rf_state "$INTERFACE")" == "up" ]]; then + if [[ "$RFKILL" == "soft" ]]; then + set_rf_state "$INTERFACE" up sleep 1 else report_fail "radio is disabled on $INTERFACE" @@ -141,7 +141,7 @@ wireless_up() { local WPA_CONF="${TMPDIR:-/tmp}/wpa.${1// /}" # substitute spaces out # make empty tmp dir with correct permissions, rename it rm -rf "$WPA_CONF" - mv -f $(mktemp -d) "$WPA_CONF" || return 1 + mv -f "$(mktemp -d)" "$WPA_CONF" || return 1 echo "ctrl_interface=/var/run/wpa_supplicant" >> "$WPA_CONF/wpa.conf" # we know $WPA_CONF now has no spaces, but it may have other nasty chars, so still needs to be quoted echo "ctrl_interface_group=${WPA_GROUP:-wheel}" >> "$WPA_CONF/wpa.conf" @@ -216,18 +216,18 @@ wireless_down() { # Handle wireless kill switches # Any reason why a hardware switch should be considered on interface down? - if [[ $RFKILL == "soft" ]]; then + if [[ "$RFKILL" == "soft" ]]; then . "$SUBR_DIR/wireless" - set_rf_state $INTERFACE down + set_rf_state "$INTERFACE" down fi } # Returns status of profile - is it still functional? wireless_status() { - load_profile $1 - if [[ "$(iwgetid -r)" -ne $ESSID ]]; then + load_profile "$1" + if [[ "$(iwgetid -r)" -ne "$ESSID" ]]; then return 1 - elif ! ip link show dev ra0 | fgrep -q "state UP"; then + elif ! ip link show dev "$INTERFACE" | fgrep -q "state UP"; then return 1 fi |