From: Roman Yeryomin Date: Mon, 21 Oct 2019 21:10:20 +0000 (+0300) Subject: base-files: uci-defaults: do config flush in one shot X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=940844e077d7d41bc94728f42b39a65854d38b87;p=openwrt%2Fstaging%2Fluka.git base-files: uci-defaults: do config flush in one shot Moving a file between tmpfs and other fs is neither faster nor safer, thus no point in doing it in two steps. Use new jshn option to write output directly to file. Originally discussed here: http://lists.openwrt.org/pipermail/openwrt-devel/2017-December/010127.html Signed-off-by: Roman Yeryomin --- diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index c2c6dc3fdc..0d2dcd5241 100755 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -615,6 +615,5 @@ board_config_update() { } board_config_flush() { - json_dump -i > /tmp/.board.json - mv /tmp/.board.json ${CFG} + json_dump -i -o ${CFG} }