From 2a201630e934b985303589fc4a5d0f2de873e153 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 30 Aug 2022 14:41:21 -0700 Subject: [PATCH] Added more text to clarify that MeshCentral needs to be offline for --resetaccount, --createaccount, --adminaccount to work. --- meshcentral.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meshcentral.js b/meshcentral.js index cfb990a2..b6ecead2 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -842,7 +842,7 @@ function CreateMeshCentralServer(config, args) { if (hashpasssplit.length != 2) { console.log("Invalid hashed password."); process.exit(); return; } user.salt = hashpasssplit[0]; user.hash = hashpasssplit[1]; - obj.db.Set(user, function () { console.log("Done."); process.exit(); return; }); + obj.db.Set(user, function () { console.log("Done. This command will only work if MeshCentral is stopped."); process.exit(); return; }); } else { // Hash the password and create the account. require('./pass').hash(obj.args.pass, function (err, salt, hash, tag) { if (err) { console.log("Unable create account password: " + err); process.exit(); return; } user.salt = salt; user.hash = hash; obj.db.Set(user, function () { console.log("Done."); process.exit(); return; }); }, 0); @@ -866,7 +866,7 @@ function CreateMeshCentralServer(config, args) { if (hashpasssplit.length != 2) { console.log("Invalid hashed password."); process.exit(); return; } user.salt = hashpasssplit[0]; user.hash = hashpasssplit[1]; - obj.db.Set(user, function () { console.log("Done."); process.exit(); return; }); + obj.db.Set(user, function () { console.log("Done. This command will only work if MeshCentral is stopped."); process.exit(); return; }); } else { // Hash the password and reset the account. require('./pass').hash(String(obj.args.pass), user.salt, function (err, hash, tag) { if (err) { console.log("Unable to reset password: " + err); process.exit(); return; } user.hash = hash; obj.db.Set(user, function () { console.log("Done."); process.exit(); return; }); }, 0); @@ -883,7 +883,7 @@ function CreateMeshCentralServer(config, args) { if (err != null) { console.log("Database error: " + err); process.exit(); return; } if ((docs == null) || (docs.length == 0)) { console.log("Unknown userid, usage: --adminaccount [userid] --domain (domain)."); process.exit(); return; } docs[0].siteadmin = 0xFFFFFFFF; // Set user as site administrator - obj.db.Set(docs[0], function () { console.log("Done."); process.exit(); return; }); + obj.db.Set(docs[0], function () { console.log("Done. This command will only work if MeshCentral is stopped."); process.exit(); return; }); }); return; }