X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/ffbd3e61655e48e3485b22dca727ffce3786fdd5..cc845615ce25c4e8ba0c60255200ae067a5d6d3d:/package/base-files/default/etc/functions.sh diff --git a/package/base-files/default/etc/functions.sh b/package/base-files/default/etc/functions.sh index e87515d6e..27b0a6d5f 100755 --- a/package/base-files/default/etc/functions.sh +++ b/package/base-files/default/etc/functions.sh @@ -1,4 +1,7 @@ #!/bin/sh +# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006 Fokus Fraunhofer + alias debug=${DEBUG:-:} # newline @@ -36,17 +39,17 @@ reset_cb() { reset_cb config () { - 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" + local cfgtype="$1" + local name="$2" + _C=$(($_C + 1)) + name="${name:-cfg${_C}}" + config_cb "$cfgtype" "$name" + export CONFIG_SECTION="$name" + export CONFIG_${CONFIG_SECTION}_TYPE="$cfgtype" } 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 +}