mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-18 09:13:14 +00:00
Updated for macos
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -40,6 +40,23 @@ function installService(params)
|
||||
if (process.platform == 'darwin')
|
||||
{
|
||||
svc.load();
|
||||
process.stdout.write(' -> setting up launch agent...');
|
||||
try
|
||||
{
|
||||
require('service-manager').manager.installLaunchAgent(
|
||||
{
|
||||
name: 'meshagent',
|
||||
servicePath: svc.appLocation(),
|
||||
startType: 'AUTO_START',
|
||||
sessionTypes: ['LoginWindow'],
|
||||
parameters: ['-kvm1']
|
||||
});
|
||||
process.stdout.write(' [DONE]\n');
|
||||
}
|
||||
catch (sie)
|
||||
{
|
||||
process.stdout.write(' [ERROR] ' + sie);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +148,21 @@ function uninstallService2(params)
|
||||
{
|
||||
process.stdout.write(' [ERROR]\n');
|
||||
}
|
||||
if (process.platform == 'darwin')
|
||||
{
|
||||
process.stdout.write(' -> Uninstalling launch agent...');
|
||||
try
|
||||
{
|
||||
var launchagent = require('service-manager').manager.getLaunchAgent('meshagent');
|
||||
launchagent.unload();
|
||||
require('fs').unlinkSync(launchagent.plist);
|
||||
process.stdout.write(' [DONE]\n');
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
process.stdout.write(' [ERROR]\n');
|
||||
}
|
||||
}
|
||||
if (params != null)
|
||||
{
|
||||
installService(params);
|
||||
|
||||
Reference in New Issue
Block a user