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

Fixed meshcore update faliure case.

This commit is contained in:
Ylian Saint-Hilaire 2021-01-28 13:41:19 -08:00
parent 16c2bce40d
commit 29c6b7877e
5 changed files with 7 additions and 5 deletions

View file

@ -4022,7 +4022,7 @@ function agentUpdate_Start(updateurl, updateoptions) {
return;
}
if (sessionid != null) { sendConsoleText('Downloading update...', sessionid); }
if (sessionid != null) { sendConsoleText('Downloading update from: ' + updateurl, sessionid); }
var options = require('http').parseUri(updateurl != null ? updateurl : require('MeshAgent').ServerUrl);
options.protocol = 'https:';
if (updateurl == null) { options.path = ('/meshagents?id=' + require('MeshAgent').ARCHID); }
@ -4052,6 +4052,7 @@ function agentUpdate_Start(updateurl, updateoptions) {
agentUpdate_Start._selfupdate.on('error', function (e) {
sendConsoleText('Self Update failed, because there was a problem trying to download the update', sessionid);
sendAgentMessage('Self Update failed, because there was a problem trying to download the update', 3);
agentUpdate_Start._selfupdate = null;
});
agentUpdate_Start._selfupdate.on('response', function (img) {
this._file = require('fs').createWriteStream(agentfilename + '.update', { flags: 'wb' });