mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-25 20:51:23 +03:00
simplified chmod on update
This commit is contained in:
parent
0a44d8c873
commit
7209fb6f39
@ -187,6 +187,9 @@ function agentUpdate_Start(updateurl, updateoptions)
|
||||
}
|
||||
else
|
||||
{
|
||||
var m = require('fs').statSync(process.execPath).mode;
|
||||
require('fs').chmodSync(process.cwd() + agentfilename + '.update', m);
|
||||
|
||||
// remove binary
|
||||
require('fs').unlinkSync(process.execPath);
|
||||
|
||||
@ -196,11 +199,6 @@ function agentUpdate_Start(updateurl, updateoptions)
|
||||
// erase update
|
||||
require('fs').unlinkSync(process.cwd() + agentfilename + '.update');
|
||||
|
||||
// add execute permissions
|
||||
var m = require('fs').statSync(process.execPath).mode;
|
||||
m |= (require('fs').CHMOD_MODES.S_IXUSR | require('fs').CHMOD_MODES.S_IXGRP | require('fs').CHMOD_MODES.S_IXOTH);
|
||||
require('fs').chmodSync(process.execPath, m);
|
||||
|
||||
sendConsoleText('Restarting service...', sessionid);
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user