qosify: add missing alias support in the init script
authorFelix Fietkau <nbd@nbd.name>
Sun, 14 Nov 2021 18:35:52 +0000 (19:35 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sun, 14 Nov 2021 18:36:34 +0000 (19:36 +0100)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/config/qosify/files/qosify.init

index 5928630dc0ae0b7cc9b405e73df47b03eff72260..040266cc32342afbb8a4f2b41a4e4f30c1620aa8 100644 (file)
@@ -71,6 +71,20 @@ add_interface() {
        json_close_object
 }
 
+add_alias() {
+       local cfg="$1"
+
+       config_get value "$cfg" value
+       config_get ingress "$cfg" ingress
+       config_get egress "$cfg" egress
+
+       json_add_array "$cfg"
+       json_add_string ingress "${ingress:-$value}"
+       json_add_string egress "${egress:-$value}"
+       json_close_array
+}
+
+
 reload_service() {
        json_init
 
@@ -82,6 +96,10 @@ reload_service() {
        config_foreach add_interface interface
        json_close_object
 
+       json_add_object aliases
+       config_foreach add_alias alias
+       json_close_object
+
        json_add_object devices
        config_foreach add_interface device
        json_close_object