From 82d2ff5e3ff5ba6c0f5d701b69c6fe9c9a7c20ae Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 2 Jan 2008 17:10:16 +0000 Subject: add uci_set_default (to be used in init scripts or /etc/uci-defaults) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10086 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/functions.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'package/base-files/files/etc') diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index 69af18750..ef2801512 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" +} -- cgit v1.2.3