summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Ambardar <itugrok@yahoo.com>2017-04-25 02:16:56 -0700
committerHans Dedecker <dedeckeh@gmail.com>2018-06-16 09:13:18 +0200
commitcf4a37a581b278d336036b186359c3cbe2c0824c (patch)
treef62004e51afba20ba88e2652b589f447d654b6ca
parent7fc94b2a25bb92c886b5de0433284b28c6a1df9a (diff)
downloadmtk-20170518-cf4a37a581b278d336036b186359c3cbe2c0824c.zip
mtk-20170518-cf4a37a581b278d336036b186359c3cbe2c0824c.tar.gz
mtk-20170518-cf4a37a581b278d336036b186359c3cbe2c0824c.tar.bz2
uci: add missing 'option' support to uci_rename()
When using the uci.sh wrapper, allow parameters to match those supported by the uci binary i.e. "uci rename <config>.<section>[.<option>]=<name>". Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
-rw-r--r--package/system/uci/files/lib/config/uci.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/package/system/uci/files/lib/config/uci.sh b/package/system/uci/files/lib/config/uci.sh
index 50891a6..78ec277 100644
--- a/package/system/uci/files/lib/config/uci.sh
+++ b/package/system/uci/files/lib/config/uci.sh
@@ -118,9 +118,10 @@ uci_add() {
uci_rename() {
local PACKAGE="$1"
local CONFIG="$2"
- local VALUE="$3"
+ local OPTION="$3"
+ local VALUE="$4"
- /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG=$VALUE"
+ /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG${VALUE:+.$OPTION}=${VALUE:-$OPTION}"
}
uci_remove() {