From 4032cdb6b457415d03019afd4394441a760e0a5c Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 29 Jun 2020 14:44:43 +0200 Subject: [PATCH] Node setup: auto-store ticket salt ... not to have to run daemon -C after node wizard before pki ticket. refs #8072 --- lib/cli/nodeutility.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/cli/nodeutility.cpp b/lib/cli/nodeutility.cpp index 523532a2401..7c886e74c68 100644 --- a/lib/cli/nodeutility.cpp +++ b/lib/cli/nodeutility.cpp @@ -375,4 +375,13 @@ void NodeUtility::UpdateConstant(const String& name, const String& value) ifp.close(); ofp.Commit(); + + std::ofstream vars; + vars.exceptions(vars.eofbit | vars.failbit | vars.badbit); + vars.open(Configuration::VarsPath.CStr(), vars.out | vars.binary | vars.ate); + + NetString::WriteStringToStream(vars, JsonEncode(new Dictionary({ + { "name", name }, + { "value", value } + }))); }