From: Felix Fietkau Date: Sat, 9 Feb 2008 17:27:43 +0000 (+0000) Subject: make uci_add() create anonymous sections if requested and store the new section name... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e1bb6ae6be49036050cf061bf1f1441482217f2e;p=openwrt%2Fstaging%2Fsvanheule.git make uci_add() create anonymous sections if requested and store the new section name in a variable SVN-Revision: 10432 --- diff --git a/package/uci/files/uci/lib/config/uci.sh b/package/uci/files/uci/lib/config/uci.sh index c221dcdc6b..9428a349dc 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() {