diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2021-05-24 16:45:06 +0200 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2021-05-27 10:58:49 +0200 |
commit | 4b9a67362d70c544b85078b8d5c661f43f7472d9 (patch) | |
tree | 62551cfc23cac0cfe27183cc662ce9f65a1af400 /package/base-files/files/lib | |
parent | 553cc47ec75ee15ff51fde714a75403450bac730 (diff) | |
download | upstream-4b9a67362d70c544b85078b8d5c661f43f7472d9.tar.gz upstream-4b9a67362d70c544b85078b8d5c661f43f7472d9.tar.bz2 upstream-4b9a67362d70c544b85078b8d5c661f43f7472d9.zip |
base-files: generate network config with "device" options
Replace "ifname" with "device" as netifd has been recently patches to
used the later one. It's more clear and accurate.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/base-files/files/lib')
-rw-r--r-- | package/base-files/files/lib/functions/uci-defaults.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 407a9c710f..02882f43ca 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -39,7 +39,7 @@ ucidef_set_interface() { [ -n "$opt" -a -n "$val" ] || break - [ "$opt" = "ifname" -a "$val" != "${val/ //}" ] && { + [ "$opt" = "device" -a "$val" != "${val/ //}" ] && { json_select_array "ports" for e in $val; do json_add_string "" "$e"; done json_close_array @@ -79,11 +79,11 @@ ucidef_set_compat_version() { } ucidef_set_interface_lan() { - ucidef_set_interface "lan" ifname "$1" protocol "${2:-static}" + ucidef_set_interface "lan" device "$1" protocol "${2:-static}" } ucidef_set_interface_wan() { - ucidef_set_interface "wan" ifname "$1" protocol "${2:-dhcp}" + ucidef_set_interface "wan" device "$1" protocol "${2:-dhcp}" } ucidef_set_interfaces_lan_wan() { @@ -201,14 +201,14 @@ _ucidef_finish_switch_roles() { json_select_object "$role" # attach previous interfaces (for multi-switch devices) - json_get_var devices ifname + json_get_var devices device if ! list_contains devices "$device"; then devices="${devices:+$devices }$device" fi json_select .. json_select .. - ucidef_set_interface "$role" ifname "$devices" + ucidef_set_interface "$role" device "$devices" done } |