uci: add uci_revert function
[openwrt/openwrt.git] / package / system / uci / files / lib / config / uci.sh
index 8d32cd1743267e05a579dd234c5d79f5491be389..6ebfb73ae440195a61f22b0f1e861231d87bffaf 100644 (file)
@@ -149,6 +149,14 @@ uci_remove_list() {
        /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} del_list "$PACKAGE.$CONFIG.$OPTION=$VALUE"
 }
 
+uci_revert() {
+       local PACKAGE="$1"
+       local CONFIG="$2"
+       local OPTION="$3"
+
+       /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} revert "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
+}
+
 uci_commit() {
        local PACKAGE="$1"
        /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit $PACKAGE