summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/config
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/lib/config')
-rw-r--r--package/base-files/files/lib/config/uci.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/base-files/files/lib/config/uci.sh b/package/base-files/files/lib/config/uci.sh
index 43bb981cc..e1571cc89 100644
--- a/package/base-files/files/lib/config/uci.sh
+++ b/package/base-files/files/lib/config/uci.sh
@@ -28,6 +28,17 @@ uci_load() {
}
}
+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"
local UPDATE="$2"