Since various packages implement such a function already on their own,
it seems reasonable to provide this a globally available function.

Signed-off-by: Michael Heimpold <m...@heimpold.de>

Index: package/base-files/files/lib/functions.sh
===================================================================
--- package/base-files/files/lib/functions.sh   (revision 29234)
+++ package/base-files/files/lib/functions.sh   (working copy)
@@ -205,6 +205,12 @@
        done
 }
 
+section_enabled() {
+       local enabled
+       config_get_bool enabled "$1" 'enabled' 0
+       [ $enabled -gt 0 ] || return 1
+}
+
 load_modules() {
        [ -d /etc/modules.d ] && {
                cd /etc/modules.d

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to