summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-02-09 17:27:43 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-02-09 17:27:43 +0000
commit9aab3598bc690b7f1c1ece7e69bdb04831b3d36e (patch)
tree090a9380ae99414f0161c0ce422d3cebd368e49e
parentf14b137da6678a79a0368bbd36bcb1f401ccc618 (diff)
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
-rw-r--r--package/uci/files/uci/lib/config/uci.sh7
1 files changed, 6 insertions, 1 deletions
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() {