Explorar o código

add uci_set_default (to be used in init scripts or /etc/uci-defaults)

SVN-Revision: 10086
Felix Fietkau %!s(int64=18) %!d(string=hai) anos
pai
achega
3b2e07b84f
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      package/base-files/files/etc/functions.sh

+ 6 - 0
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"
+}