diff options
author | Travis Kemen <thepeople@openwrt.org> | 2007-05-16 14:46:23 +0000 |
---|---|---|
committer | Travis Kemen <thepeople@openwrt.org> | 2007-05-16 14:46:23 +0000 |
commit | ff111c2511fb093fde422ac8f194bba53f457586 (patch) | |
tree | 277b40e1cf9f837804be21573c7a4af6f71ca5ed | |
parent | 8693233b735bc1b50fcf39daf9db6e0913aed3fa (diff) | |
download | mtk-20170518-ff111c2511fb093fde422ac8f194bba53f457586.zip mtk-20170518-ff111c2511fb093fde422ac8f194bba53f457586.tar.gz mtk-20170518-ff111c2511fb093fde422ac8f194bba53f457586.tar.bz2 |
keep uci_set from saving things that have not changed
SVN-Revision: 7259
-rw-r--r-- | package/base-files/files/lib/config/uci.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/package/base-files/files/lib/config/uci.sh b/package/base-files/files/lib/config/uci.sh index a76300f..e029336 100644 --- a/package/base-files/files/lib/config/uci.sh +++ b/package/base-files/files/lib/config/uci.sh @@ -76,8 +76,11 @@ uci_set() { ( # spawn a subshell so you don't mess up the current environment uci_load "$PACKAGE" - config_get type "$CONFIG" TYPE - [ -z "$type" ] + config_get OLDVAL "$CONFIG" "$OPTION" + if [ "$OLDVAL" != "$VALUE" ]; then + config_get type "$CONFIG" TYPE + [ -z "$type" ] + fi ) || uci_add_update "$PACKAGE" "config_set '$CONFIG' '$OPTION' '$VALUE'" } |