diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-07-15 14:52:38 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-07-15 14:52:38 +0000 |
commit | 9ee12e3f62fcd7e15cd0d045053c7a66c19a0024 (patch) | |
tree | d87919c615f4399557310b1ecbca9d3fd4ac079a /package | |
parent | e084d0e92adabc1a53e4e078c076e4427e8e2332 (diff) | |
download | upstream-9ee12e3f62fcd7e15cd0d045053c7a66c19a0024.tar.gz upstream-9ee12e3f62fcd7e15cd0d045053c7a66c19a0024.tar.bz2 upstream-9ee12e3f62fcd7e15cd0d045053c7a66c19a0024.zip |
uci: implement a uci_toogle_state() wrapper in the shell api which calls uci_revert_state() before uci_set_state()
SVN-Revision: 27614
Diffstat (limited to 'package')
-rw-r--r-- | package/uci/Makefile | 4 | ||||
-rw-r--r-- | package/uci/files/lib/config/uci.sh | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/package/uci/Makefile b/package/uci/Makefile index 5a9b855002..08b38f916f 100644 --- a/package/uci/Makefile +++ b/package/uci/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2008 OpenWrt.org +# Copyright (C) 2008-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -12,7 +12,7 @@ UCI_RELEASE=2 PKG_NAME:=uci PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE)) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_REV:=5b6e96336d6a615a72c274cceaea8c2fe74d7642 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/package/uci/files/lib/config/uci.sh b/package/uci/files/lib/config/uci.sh index 8dcb92b9f8..db84c8343e 100644 --- a/package/uci/files/lib/config/uci.sh +++ b/package/uci/files/lib/config/uci.sh @@ -71,6 +71,11 @@ uci_set_state() { /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P /var/state set "$PACKAGE.$CONFIG${OPTION:+.$OPTION}=$VALUE" } +uci_toggle_state() { + uci_revert_state "$1" "$2" "$3" + uci_set_state "$1" "$2" "$3" "$4" +} + uci_set() { local PACKAGE="$1" local CONFIG="$2" |