diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-01-18 00:38:04 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-01-18 00:38:04 +0000 |
commit | 65c8d28d39e590c291f7f40360a9ff2f930925de (patch) | |
tree | 4852e7a6d22a337a7c3536452ed2b3a18dcec83c /package/swconfig/files/switch.sh | |
parent | 5ab0ca0fd51fd8856f3359956e85178d4c94f5c2 (diff) |
swconfig: support providing the switch device name in an option instead of the section name - necessary to support switches that contain characters such as "-"
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19208 3c298f89-4303-0410-b956-a3cf2f4a3e73
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 7078b2e82..18d5fbd2c 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() { |