summaryrefslogtreecommitdiff
path: root/package/uci/files
diff options
context:
space:
mode:
Diffstat (limited to 'package/uci/files')
-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 c221dcd..9428a34 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() {