mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2024-12-30 02:22:09 +00:00
5a9c834a12
Let the first parameter of function config_get be local, because there is a chance that config_get won't export the variable. Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> SVN-Revision: 41000
16 lines
296 B
Bash
16 lines
296 B
Bash
#!/bin/sh
|
|
# Copyright (C) 2009 OpenWrt.org
|
|
|
|
setup_switch_dev() {
|
|
local name
|
|
config_get name "$1" name
|
|
name="${name:-$1}"
|
|
[ -d "/sys/class/net/$name" ] && ifconfig "$name" up
|
|
swconfig dev "$name" load network
|
|
}
|
|
|
|
setup_switch() {
|
|
config_load network
|
|
config_foreach setup_switch_dev switch
|
|
}
|