diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-03-01 01:33:12 +0100 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-03-01 01:35:58 +0100 |
commit | eed3f590c9db7cd9cd4d5fb4722fc7257a278ea6 (patch) | |
tree | d34406a8af61dccbb9655b899da30d04ce61a623 /src/connections/vlan | |
parent | 8d1c5e8ec6b637015e84bbb154ece9065c59f1c5 (diff) | |
download | netctl-eed3f590c9db7cd9cd4d5fb4722fc7257a278ea6.tar.gz netctl-eed3f590c9db7cd9cd4d5fb4722fc7257a278ea6.tar.xz |
Code quality upgrade
This is what you get when Dave Reisner points you at some bash anti-patterns.
Also in this commit:
- updated documentation
- bugfix revision of the IPv6 SLAAC address/route bug
Diffstat (limited to 'src/connections/vlan')
-rw-r--r-- | src/connections/vlan | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/connections/vlan b/src/connections/vlan index 7b81e7f..97147c7 100644 --- a/src/connections/vlan +++ b/src/connections/vlan @@ -5,12 +5,12 @@ vlan_up() { local vlan_interface load_profile "$1" - if [ -e /sys/class/net/$INTERFACE ]; then + if [[ -e "/sys/class/net/$INTERFACE" ]]; then report_fail "Interface $INTERFACE already exists." exit 1 else - ip link set $VLAN_PHYS_DEV up - ip link add link $VLAN_PHYS_DEV name $INTERFACE type vlan id $VLAN_ID >/dev/null 2>&1 + ip link set "$VLAN_PHYS_DEV" up + ip link add link "$VLAN_PHYS_DEV" name "$INTERFACE" type vlan id "$VLAN_ID" >/dev/null 2>&1 fi bring_interface up "$INTERFACE" "$CONN_DIR/ethernet" up "$1" @@ -23,12 +23,12 @@ vlan_down() { "$CONN_DIR/ethernet" down "$1" bring_interface down "$INTERFACE" - ip link delete $INTERFACE >/dev/null 2>&1 + ip link delete "$INTERFACE" >/dev/null 2>&1 return 0 } vlan_status() { - if [ -e /sys/class/net/$INTERFACE ]; then + if [[ -e "/sys/class/net/$INTERFACE" ]]; then return 0 else return 1 |