X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/d84cebe2b4f101902f62f0e25fc473d1af7bb269..572cb3cc9e32a39a457b8fd9bbb262f0e0470791:/package/base-files/files/etc/functions.sh?ds=inline diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index eb7faac1f..d5ffc1353 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -2,8 +2,13 @@ # Copyright (C) 2006 OpenWrt.org # Copyright (C) 2006 Fokus Fraunhofer -alias debug=${DEBUG:-:} -alias mount='busybox mount' + +debug () { + ${DEBUG:-:} "$@" +} +mount() { + busybox mount "$@" +} # newline N=" @@ -92,6 +97,7 @@ list() { local len 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" @@ -258,7 +264,7 @@ jffs2_mark_erase() { echo -e "\xde\xad\xc0\xde" | mtd -qq write - "$1" } -uci_apply_defaults() {( +uci_apply_defaults() { cd /etc/uci-defaults || return 0 files="$(ls)" [ -z "$files" ] && return 0 @@ -267,6 +273,6 @@ uci_apply_defaults() {( ( . "./$(basename $file)" ) && rm -f "$file" done uci commit -)} +} [ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh