1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-20 18:23:21 +00:00

Updated escaping rules for agent installer for linux systemd

This commit is contained in:
Bryan Roe
2022-04-26 15:10:32 -07:00
parent a0cd3e3587
commit 3a79731fed
4 changed files with 107 additions and 39 deletions

View File

@@ -180,7 +180,8 @@ function installService(params)
{
var mshFile = process.platform == 'win32' ? (process.execPath.split('.exe').join('.msh')) : (process.execPath + '.msh');
if (options.files == null) { options.files = []; }
options.files.push({ source: mshFile, newName: options.target + '.msh' });
var newtarget = (process.platform == 'linux' && require('service-manager').manager.getServiceType() == 'systemd') ? options.target.split("'").join('-') : options.target;
options.files.push({ source: mshFile, newName: newtarget + '.msh' });
options.parameters.splice(i, 1);
}
if ((i=params.indexOf('--_localService="1"'))>=0)