mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-22 04:18:10 +00:00
base-files: migrate old UCI network bridge ports syntax
netifd has been recently patched to use more accurate "ports" option instead of "ifname". This is a simple translation between two UCI options. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: maurerr <mariusd84@gmail.com>
This commit is contained in:
parent
ccd1fcb6d7
commit
5012a2d2e3
@ -0,0 +1,23 @@
|
|||||||
|
. /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
|
||||||
|
|
||||||
|
exit 1
|
Loading…
Reference in New Issue
Block a user