diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-01-18 00:38:04 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-01-18 00:38:04 +0000 |
commit | 45b797478c52ca1408bf2a2d13b0c967b92f2bc1 (patch) | |
tree | 4852e7a6d22a337a7c3536452ed2b3a18dcec83c /package/swconfig/files | |
parent | 764549aa545cb03a24ff41eabed91a2cab920d00 (diff) | |
download | upstream-45b797478c52ca1408bf2a2d13b0c967b92f2bc1.tar.gz upstream-45b797478c52ca1408bf2a2d13b0c967b92f2bc1.tar.bz2 upstream-45b797478c52ca1408bf2a2d13b0c967b92f2bc1.zip |
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')
-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() { |