add missing function (https://dev.openwrt.org/ticket/1745#comment:3)
authorFelix Fietkau <nbd@openwrt.org>
Sat, 30 Jun 2007 19:50:45 +0000 (19:50 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 30 Jun 2007 19:50:45 +0000 (19:50 +0000)
SVN-Revision: 7808

openwrt/package/qos-scripts/files/usr/lib/qos/generate.sh

index fe59d436321f3a8cd41282beb39fde2c92e325e7..838dddcccd62b9414e834b01edc2d7e138956162 100755 (executable)
@@ -10,6 +10,18 @@ add_insmod() {
        esac
 }
 
+# Kamikaze compatibility function
+# config_get_bool <variable> <section> <option> [<default>]
+config_get_bool() {
+       local _tmp
+       config_get "_tmp" "$2" "$3"
+       case "$_tmp" in
+               1|on|enabled) export ${NO_EXPORT:+-n} "$1=1";;
+               0|off|disabled) export ${NO_EXPORT:+-n} "$1=0";;
+               *) eval "$1=${4:-0}";;
+       esac
+}
+
 parse_matching_rule() {
        local var="$1"
        local section="$2"