Add an 'Image Configuration' menu to menuconfig
[openwrt.org/openwrt.git] / package / base-files / files / lib / config / uci.sh
blob:a/package/base-files/files/lib/config/uci.sh -> blob:b/package/base-files/files/lib/config/uci.sh
--- a/package/base-files/files/lib/config/uci.sh
+++ b/package/base-files/files/lib/config/uci.sh
@@ -27,6 +27,17 @@
 		config_cb
 	}
 }
+
+uci_apply_defaults() {(
+	cd /etc/uci-defaults || return 0
+	files="$(ls)"
+	[ -z "$files" ] && return 0
+	mkdir -p /tmp/.uci
+	for file in $files; do
+		( . "./$(basename $file)" ) && rm -f "$file"
+	done
+	uci commit
+)}
 
 uci_do_update() {
 	local FILENAME="$1"

comments