1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added MeshCommand_CoreOk.

This commit is contained in:
Ylian Saint-Hilaire 2019-01-17 15:07:34 -08:00
parent 1bf859f0d1
commit 46024e62a0
13 changed files with 10 additions and 9 deletions

View file

@ -112,18 +112,19 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
if (agentMeshCoreHash != meshcorehash) {
if (obj.agentCoreCheck < 5) {
if (meshcorehash == null) {
// Update no core
obj.send(obj.common.ShortToStr(10) + obj.common.ShortToStr(0)); // Command 10, ask mesh agent to clear the core
// Clear the core
obj.send(obj.common.ShortToStr(10) + obj.common.ShortToStr(0)); // MeshCommand_CoreModule, ask mesh agent to clear the core
obj.parent.parent.debug(1, 'Clearing core');
} else {
// Update new core
obj.send(obj.common.ShortToStr(10) + obj.common.ShortToStr(0) + meshcorehash + obj.parent.parent.defaultMeshCores[corename]);
obj.send(obj.common.ShortToStr(10) + obj.common.ShortToStr(0) + meshcorehash + obj.parent.parent.defaultMeshCores[corename]); // MeshCommand_CoreModule, start core update
obj.parent.parent.debug(1, 'Updating code ' + corename);
}
obj.agentCoreCheck++;
}
} else {
obj.agentCoreCheck = 0;
obj.send(obj.common.ShortToStr(16) + obj.common.ShortToStr(0)); // MeshCommand_CoreOk. Indicates to the agent that the core is ok. Start it if it's not already started.
}
}