diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-07-29 19:59:45 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-07-29 19:59:45 +0000 |
commit | 85b8f04fac05a84225d56e0b8b60a6427417164d (patch) | |
tree | 40bd2d32a7120422070663018a4fc907ce7b730a /package | |
parent | 38453d3dc06cbabab2b56a65067c390b757baeb8 (diff) | |
download | upstream-85b8f04fac05a84225d56e0b8b60a6427417164d.tar.gz upstream-85b8f04fac05a84225d56e0b8b60a6427417164d.tar.bz2 upstream-85b8f04fac05a84225d56e0b8b60a6427417164d.zip |
fix unnamed config sections
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4321 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-x | package/base-files/default/etc/functions.sh | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/package/base-files/default/etc/functions.sh b/package/base-files/default/etc/functions.sh index a7f7c42e22..03fd23807a 100755 --- a/package/base-files/default/etc/functions.sh +++ b/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 +} |