From 54bbc306875d7eb7dc3b86016242580004a9644b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 18 Jan 2010 00:38:04 +0000 Subject: swconfig: support providing the switch device name in an option instead of the section name - necessary to support switches that contain characters such as "-" SVN-Revision: 19208 --- package/swconfig/files/switch.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'package/swconfig/files/switch.sh') 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() { -- cgit v1.2.3