mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-07 02:53:58 +00:00
Added support for mesh_daemon to enumerate and uninstall
This commit is contained in:
@@ -1422,6 +1422,9 @@ function serviceManager()
|
||||
paths.push('/lib/systemd/system');
|
||||
paths.push('/usr/lib/systemd/system');
|
||||
break;
|
||||
default:
|
||||
paths.push('/usr/local/mesh_daemons');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'freebsd':
|
||||
@@ -1477,6 +1480,18 @@ function serviceManager()
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (files[j].endsWith('.service'))
|
||||
{
|
||||
try
|
||||
{
|
||||
results.push(this.getService(files[j].split('.service')[0], 'unknown'));
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'freebsd':
|
||||
@@ -2072,6 +2087,25 @@ function serviceManager()
|
||||
}
|
||||
break;
|
||||
default: // unknown platform service type
|
||||
if (service.isRunning())
|
||||
{
|
||||
service.stop();
|
||||
}
|
||||
try
|
||||
{
|
||||
require('fs').unlinkSync(servicePath);
|
||||
}
|
||||
catch(x)
|
||||
{
|
||||
}
|
||||
try
|
||||
{
|
||||
require('fs').unlinkSync(service.conf);
|
||||
}
|
||||
catch(x)
|
||||
{
|
||||
}
|
||||
console.log(name + ' uninstalled');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user