summaryrefslogtreecommitdiff
path: root/package/base-files/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
commit3b2e07b84fc38f8fed75f3c38d6375f8b08bc8f4 (patch)
treec369c17d562ef44c040d2c26420db3d066c8355c /package/base-files/files
parent162f0194a155e46064ad282f60fe47865a4a0130 (diff)
downloadmtk-20170518-3b2e07b84fc38f8fed75f3c38d6375f8b08bc8f4.zip
mtk-20170518-3b2e07b84fc38f8fed75f3c38d6375f8b08bc8f4.tar.gz
mtk-20170518-3b2e07b84fc38f8fed75f3c38d6375f8b08bc8f4.tar.bz2
add uci_set_default (to be used in init scripts or /etc/uci-defaults)
SVN-Revision: 10086
Diffstat (limited to 'package/base-files/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 69af187..ef28015 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"
+}