enable services via cli

This commit is contained in:
Djeeberjr 2023-06-04 15:44:11 +02:00
parent 30304ec5e6
commit cd6808e62c
2 changed files with 10 additions and 1 deletions

View File

@ -63,6 +63,15 @@ class Service extends CLIAppBase {
return true; return true;
},"List all services"); },"List all services");
registerSyncSubcommand("enable", (args) ->{
if (args.length < 1) {
return false;
}
ServiceManager.instance.enable(args[0]);
return true;
},"Enable a service");
} }
private function handleResult(res: Outcome<Noise,String>): Bool { private function handleResult(res: Outcome<Noise,String>): Bool {

View File

@ -19,7 +19,7 @@ class ServiceManager {
/** /**
Add a service to be automatically started. Add a service to be automatically started.
**/ **/
private function enable(name: String) { public function enable(name: String) {
if (!this.services.exists(name)){ if (!this.services.exists(name)){
return; // Service must be started return; // Service must be started
} }