aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'package/network/config/qos-scripts/files/usr/lib/qos/generate.sh')
-rwxr-xr-xpackage/network/config/qos-scripts/files/usr/lib/qos/generate.sh45
1 files changed, 22 insertions, 23 deletions
diff --git a/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh b/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
index 9ce4eb41ef..48c9f4a9df 100755
--- a/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
+++ b/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
@@ -191,8 +191,6 @@ config_cb() {
option_cb() {
return 0
}
-
- # Section start
case "$1" in
interface)
config_set "$2" "classgroup" "Default"
@@ -200,43 +198,41 @@ config_cb() {
;;
classify|default|reclassify)
option_cb() {
- append options "$1"
+ append "CONFIG_${CONFIG_SECTION}_options" "$1"
}
;;
esac
+}
- # Section end
- config_get TYPE "$CONFIG_SECTION" TYPE
+qos_parse_config() {
+ config_get TYPE "$1" TYPE
case "$TYPE" in
interface)
- config_get_bool enabled "$CONFIG_SECTION" enabled 1
- [ 1 -eq "$enabled" ] || return 0
- config_get classgroup "$CONFIG_SECTION" classgroup
- config_set "$CONFIG_SECTION" ifbdev "$C"
- C=$(($C+1))
- append INTERFACES "$CONFIG_SECTION"
- config_set "$classgroup" enabled 1
- config_get device "$CONFIG_SECTION" device
- [ -z "$device" ] && {
- device="$(find_ifname ${CONFIG_SECTION})"
- config_set "$CONFIG_SECTION" device "$device"
+ config_get_bool enabled "$1" enabled 1
+ [ 1 -eq "$enabled" ] && {
+ config_get classgroup "$1" classgroup
+ config_set "$1" ifbdev "$C"
+ C=$(($C+1))
+ append INTERFACES "$1"
+ config_set "$classgroup" enabled 1
+ config_get device "$1" device
+ [ -z "$device" ] && {
+ device="$(find_ifname $1)"
+ config_set "$1" device "$device"
+ }
}
;;
- classgroup) append CG "$CONFIG_SECTION";;
+ classgroup) append CG "$1";;
classify|default|reclassify)
case "$TYPE" in
classify) var="ctrules";;
*) var="rules";;
esac
- config_get target "$CONFIG_SECTION" target
- config_set "$CONFIG_SECTION" options "$options"
- append "$var" "$CONFIG_SECTION"
- unset options
+ append "$var" "$1"
;;
esac
}
-
enum_classes() {
local c="0"
config_get classes "$1" classes
@@ -500,7 +496,10 @@ INTERFACES=""
[ -e ./qos.conf ] && {
. ./qos.conf
config_cb
-} || config_load qos
+} || {
+ config_load qos
+ config_foreach qos_parse_config
+}
C="0"
for iface in $INTERFACES; do