aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-01-02 17:10:16 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-01-02 17:10:16 +0000
commit039590c86aad23845f054010fc9d7ed36c7c5f45 (patch)
treed24fa03c6cccfe4dee390a57f21ad45c1d523aab /package/base-files
parentcbd197015c303fa23ddab90ddf55c6ac5098afd4 (diff)
downloadupstream-039590c86aad23845f054010fc9d7ed36c7c5f45.tar.gz
upstream-039590c86aad23845f054010fc9d7ed36c7c5f45.tar.bz2
upstream-039590c86aad23845f054010fc9d7ed36c7c5f45.zip
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
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/etc/functions.sh6
1 files changed, 6 insertions, 0 deletions
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"
+}