qos-scripts: convert to procd
authorFelix Fietkau <nbd@openwrt.org>
Fri, 18 Jul 2014 11:25:07 +0000 (11:25 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 18 Jul 2014 11:25:07 +0000 (11:25 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 41730

package/network/config/qos-scripts/files/etc/init.d/qos

index 3f711155ee241ab0c61be8729e246a1f2151174a..712d906f03f9b9913cf624680f9d374993b7c731 100755 (executable)
@@ -2,15 +2,27 @@
 # Copyright (C) 2006 OpenWrt.org
 
 START=50
+USE_PROCD=1
 
-boot() {
-       /usr/lib/qos/generate.sh firewall | sh
+validate_qos_section()
+{
+       uci_validate_section qos interface "${1}" \
+               'enabled:bool' \
+               'upload:uinteger' \
+               'download:uinteger'
 }
 
-start() {
+service_triggers()
+{
+       procd_add_reload_trigger "qos"
+       procd_add_validation validate_qos_section
        qos-start
 }
 
-stop() {
-       qos-stop
+start_service() {
+       qos-start
+}
+
+reload_service() {
+       qos-start
 }