diff options
Diffstat (limited to 'package/swconfig/files/switch.sh')
-rw-r--r-- | package/swconfig/files/switch.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/package/swconfig/files/switch.sh b/package/swconfig/files/switch.sh index 7078b2e823..18d5fbd2c3 100644 --- a/package/swconfig/files/switch.sh +++ b/package/swconfig/files/switch.sh @@ -2,8 +2,10 @@ # Copyright (C) 2009 OpenWrt.org setup_switch_dev() { - ifconfig "$1" 0.0.0.0 - swconfig dev "$1" load network + config_get name "$1" name + name="${name:-$1}" + [ -d "/sys/class/net/$name" ] && ifconfig "$name" up + swconfig dev "$name" load network } setup_switch() { |