big refactor

This commit is contained in:
redanthrax 2022-06-17 16:45:28 -07:00
parent 6abf716844
commit 7fbb0fe7e1
25 changed files with 2761 additions and 822 deletions

View file

@ -311,26 +311,7 @@ func DeleteSchedTask(name string) error {
return nil
}
// CleanupSchedTasks removes all tacticalrmm sched tasks during uninstall
func CleanupSchedTasks() {
conn, err := taskmaster.Connect()
if err != nil {
return
}
defer conn.Disconnect()
tasks, err := conn.GetRegisteredTasks()
if err != nil {
return
}
for _, task := range tasks {
if strings.HasPrefix(task.Name, "TacticalRMM_") {
conn.DeleteTask(fmt.Sprintf("\\%s", task.Name))
}
}
tasks.Release()
}
func ListSchedTasks() []string {
ret := make([]string, 0)