mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-16 00:03:45 +00:00
Updated self update to display update message in console mode on linux
This commit is contained in:
@@ -5651,6 +5651,7 @@ int MeshAgent_Start(MeshAgentHostContainer *agentHost, int paramLen, char **para
|
||||
ILIBLOGMESSSAGE("SelfUpdate -> Service Check... [NO]");
|
||||
ILIBLOGMESSSAGE("SelfUpdate -> Manual Mode (COMPLETE)");
|
||||
}
|
||||
ignore_result(write(STDOUT_FILENO, "SelfUpdate -> Updating Agent...\n", 32));
|
||||
|
||||
// Generic update process, call our own update with arguments.
|
||||
struct stat results;
|
||||
@@ -5660,6 +5661,7 @@ int MeshAgent_Start(MeshAgentHostContainer *agentHost, int paramLen, char **para
|
||||
remove(agentHost->exePath);
|
||||
sprintf_s(ILibScratchPad, sizeof(ILibScratchPad), "cp %s %s", updateFilePath, agentHost->exePath);
|
||||
if (system(ILibScratchPad)) {}
|
||||
ignore_result(write(STDOUT_FILENO, "SelfUpdate -> Restarting Agent...\n", 34));
|
||||
|
||||
execv(agentHost->exePath, agentHost->execparams);
|
||||
_exit(1);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -585,12 +585,14 @@ function sys_update(isservice, b64)
|
||||
{
|
||||
// This is run on the 'updated' agent.
|
||||
|
||||
var parm = b64 != null ? JSON.parse(Buffer.from(b64, 'base64').toString()) : null;
|
||||
var service = null;
|
||||
var serviceLocation = "";
|
||||
var px;
|
||||
|
||||
console.setInfoLevel(1);
|
||||
if (isservice)
|
||||
{
|
||||
var parm = b64 != null ? JSON.parse(Buffer.from(b64, 'base64').toString()) : null;
|
||||
|
||||
console.info1('sys_update(' + isservice + ', ' + JSON.stringify(parm) + ')');
|
||||
if ((px = parm.getParameterIndex('fakeUpdate')) >= 0)
|
||||
{
|
||||
@@ -598,8 +600,7 @@ function sys_update(isservice, b64)
|
||||
parm.splice(px, 1);
|
||||
}
|
||||
|
||||
if (isservice)
|
||||
{
|
||||
|
||||
//
|
||||
// Service Mode
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user