From 9aab3598bc690b7f1c1ece7e69bdb04831b3d36e Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 9 Feb 2008 17:27:43 +0000 Subject: make uci_add() create anonymous sections if requested and store the new section name in a variable git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10432 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/uci/files/uci/lib/config/uci.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/uci/files/uci/lib/config/uci.sh b/package/uci/files/uci/lib/config/uci.sh index c221dcdc6..9428a349d 100644 --- a/package/uci/files/uci/lib/config/uci.sh +++ b/package/uci/files/uci/lib/config/uci.sh @@ -68,7 +68,12 @@ uci_add() { local TYPE="$2" local CONFIG="$3" - /sbin/uci set "$PACKAGE.$CONFIG=$TYPE" + if [ -z "$CONFIG" ]; then + export ${NO_EXPORT:+-n} CONFIG_SECTION="$(/sbin/uci add "$PACKAGE" "$TYPE")" + else + /sbin/uci set "$PACKAGE.$CONFIG=$TYPE" + export ${NO_EXPORT:+-n} CONFIG_SECTION="$CONFIG" + fi } uci_rename() { -- cgit v1.2.3