mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 07:22:33 +00:00
24 lines
449 B
Plaintext
24 lines
449 B
Plaintext
|
. /lib/functions.sh
|
||
|
|
||
|
migrate_ports() {
|
||
|
local config="$1"
|
||
|
local type ports ifname
|
||
|
|
||
|
config_get type "$config" type
|
||
|
[ "$type" != "bridge" ] && return
|
||
|
|
||
|
config_get ports "$config" ports
|
||
|
[ -n "$ports" ] && return
|
||
|
|
||
|
config_get ifname "$config" ifname
|
||
|
[ -z "$ifname" ] && return
|
||
|
|
||
|
for port in $ifname; do
|
||
|
uci add_list network.$config.ports="$port"
|
||
|
done
|
||
|
uci delete network.$config.ifname
|
||
|
}
|
||
|
|
||
|
config_load network
|
||
|
config_foreach migrate_ports device
|