base-files: support "metric" in board.json
authorRafał Miłecki <rafal@milecki.pl>
Sat, 3 Sep 2022 12:31:29 +0000 (14:31 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Sat, 10 Sep 2022 14:58:01 +0000 (16:58 +0200)
It allows prepopulating /etc/config/network interface-s with predefined
metric. It may be useful for devices with multiple WAN ports.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
package/base-files/files/bin/config_generate

index 596fcf41fad5b21253d8f1fa74011a7387ffbdd9..38362813d1924c715235c8259b593f0335029b9c 100755 (executable)
@@ -96,7 +96,7 @@ generate_network() {
 
        json_select network
                json_select "$1"
-                       json_get_vars device macaddr protocol ipaddr netmask vlan
+                       json_get_vars device macaddr metric protocol ipaddr netmask vlan
                        json_get_values ports ports
                json_select ..
        json_select ..
@@ -154,6 +154,7 @@ generate_network() {
                set network.$1='interface'
                set network.$1.type='$type'
                set network.$1.device='$device'
+               set network.$1.metric='$metric'
                set network.$1.proto='none'
        EOF