From: Felix Fietkau Date: Wed, 2 Jan 2008 17:10:16 +0000 (+0000) Subject: add uci_set_default (to be used in init scripts or /etc/uci-defaults) X-Git-Tag: 8.09_rc1~1886 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3b2e07b84fc38f8fed75f3c38d6375f8b08bc8f4;p=openwrt%2Fsvn-archive%2Fopenwrt.git add uci_set_default (to be used in init scripts or /etc/uci-defaults) SVN-Revision: 10086 --- diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index 69af187502..ef2801512f 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -217,3 +217,9 @@ jffs2_mark_erase() { } echo -e "\xde\xad\xc0\xde" | mtd -qq write - "$1" } + +uci_set_default() { + local PACKAGE="$1" + [ -e "/etc/config/$1" ] && return 0 + cat > "/etc/config/$1" +}