1 #!/bin/sh /etc/rc.common
2 # Copyright (c) 2021 OpenWrt.org
13 config_get val
"$cfg" "$name"
15 [ -n "$val" ] && json_add_
$type "$name" "$val"
21 json_add_boolean
reset 1
23 config_get files
"$cfg" defaults
26 json_add_string
"" "$i"
30 add_option int timeout
31 add_option string dscp_prio
32 add_option string dscp_bulk
33 add_option string dscp_icmp
34 add_option string dscp_default_udp
35 add_option string dscp_default_tcp
36 add_option int bulk_trigger_timeout
37 add_option int bulk_trigger_pps
38 add_option int prio_max_avg_pkt_len
44 config_get_bool disabled
"$cfg" disabled
0
45 [ "$disabled" -gt 0 ] && return
47 config_get name
"$cfg" name
48 json_add_object
"$name"
50 config_get bw
"$cfg" bandwidth
52 config_get bw_up
"$cfg" bandwidth_up
54 [ -n "$bw_up" ] && json_add_string bandwidth_up
"$bw_up"
56 config_get bw_down
"$cfg" bandwidth_down
57 bw_down
="${bw_down:-$bw}"
58 [ -n "$bw_down" ] && json_add_string bandwidth_down
"$bw_down"
60 add_option string bandwidth
61 add_option boolean ingress
62 add_option boolean egress
63 add_option string mode
64 add_option boolean host_isolate
65 add_option boolean autorate_ingress
66 add_option string ingress_options
67 add_option string egress_options
68 add_option string options
78 config_foreach add_defaults defaults
80 json_add_object interfaces
81 config_foreach add_interface interface
84 json_add_object devices
85 config_foreach add_interface device
88 ubus call qosify config
"$(json_dump)"
92 procd_add_reload_trigger qosify
97 procd_set_param
command "$PROG"
98 procd_set_param respawn
103 ubus
-t 10 wait_for qosify
104 [ $?
= 0 ] && reload_service