returned existing files to origin during restruct
This commit is contained in:
parent
7fbb0fe7e1
commit
a2ed11b2fb
19 changed files with 1678 additions and 102 deletions
|
|
@ -311,7 +311,26 @@ 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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue