summaryrefslogtreecommitdiff
path: root/openwrt/package/base-files/default/etc/functions.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-07-29 19:59:45 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-07-29 19:59:45 +0000
commit39a8c5b8ff7e264715841d83f62b5b3401752de4 (patch)
tree386c5708c69a411308d7b7f2f095b4fc9c5d99ff /openwrt/package/base-files/default/etc/functions.sh
parenta12f821123609fbd0c6e207158dd794c485e6455 (diff)
downloadmtk-20170518-39a8c5b8ff7e264715841d83f62b5b3401752de4.zip
mtk-20170518-39a8c5b8ff7e264715841d83f62b5b3401752de4.tar.gz
mtk-20170518-39a8c5b8ff7e264715841d83f62b5b3401752de4.tar.bz2
fix unnamed config sections
SVN-Revision: 4321
Diffstat (limited to 'openwrt/package/base-files/default/etc/functions.sh')
-rwxr-xr-xopenwrt/package/base-files/default/etc/functions.sh21
1 files changed, 15 insertions, 6 deletions
diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh
index a7f7c42..03fd238 100755
--- a/openwrt/package/base-files/default/etc/functions.sh
+++ b/openwrt/package/base-files/default/etc/functions.sh
@@ -1,5 +1,6 @@
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
alias debug=${DEBUG:-:}
@@ -38,15 +39,17 @@ reset_cb() {
reset_cb
config () {
- _C=$(($_C + 1))
- name="${name:-cfg${_C}}"
- config_cb "$1" "$2"
- export CONFIG_SECTION="$2"
- export CONFIG_${CONFIG_SECTION}_TYPE="$1"
+ local type="$1"
+ local name="$2"
+ _C=$(($_C + 1))
+ name="${name:-cfg${_C}}"
+ config_cb "$type" "$name"
+ export CONFIG_SECTION="$name"
+ export CONFIG_${CONFIG_SECTION}_TYPE="$type"
}
option () {
- local varname="$1" ; shift
+ local varname="$1"; shift
export CONFIG_${CONFIG_SECTION}_${varname}="$*"
option_cb "$varname" "$*"
}
@@ -88,3 +91,9 @@ config_set() {
load_modules() {
sed 's/^[^#]/insmod &/' $* | ash 2>&- || :
}
+
+include() {
+ for file in $(ls /lib/$1/*.sh 2>/dev/null); do
+ . $file
+ done
+}