X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/97501ba110b24d9781a4bbc99765f20ce1f36477..e81aa5345378227c5cb32cd1fe2f71aeb544bcbc:/package/base-files/files/etc/functions.sh diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index 28bd79201..acea61753 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -2,7 +2,13 @@ # Copyright (C) 2006 OpenWrt.org # Copyright (C) 2006 Fokus Fraunhofer -alias debug=${DEBUG:-:} + +debug () { + ${DEBUG:-:} "$@" +} +mount() { + busybox mount "$@" +} # newline N=" @@ -90,8 +96,9 @@ list() { local value="$*" local len - config_get len "$CONFIG_SECTION" "${varname}_LENGTH" - len="$((${len:-0} + 1))" + config_get len "$CONFIG_SECTION" "${varname}_LENGTH" 0 + [ $len = 0 ] && append CONFIG_LIST_STATE "${CONFIG_SECTION}_${varname}" + len=$(($len + 1)) config_set "$CONFIG_SECTION" "${varname}_ITEM$len" "$value" config_set "$CONFIG_SECTION" "${varname}_LENGTH" "$len" append "CONFIG_${CONFIG_SECTION}_${varname}" "$value" "$LIST_SEP" @@ -133,22 +140,25 @@ config_clear() { done } +# config_get