62 lines
984 B
Go
62 lines
984 B
Go
/*
|
|
Copyright 2022 AmidaWare LLC.
|
|
|
|
Licensed under the Tactical RMM License Version 1.0 (the “License”).
|
|
You may only use the Licensed Software in accordance with the License.
|
|
A copy of the License is available at:
|
|
|
|
https://license.tacticalrmm.com
|
|
|
|
*/
|
|
|
|
package agent
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
"time"
|
|
)
|
|
|
|
type Installer struct {
|
|
Headers map[string]string
|
|
RMM string
|
|
ClientID int
|
|
SiteID int
|
|
Description string
|
|
AgentType string
|
|
Power bool
|
|
RDP bool
|
|
Ping bool
|
|
Token string
|
|
LocalMesh string
|
|
Cert string
|
|
Proxy string
|
|
Timeout time.Duration
|
|
SaltMaster string
|
|
Silent bool
|
|
NoMesh bool
|
|
MeshDir string
|
|
MeshNodeID string
|
|
}
|
|
|
|
|
|
|
|
func copyFile(src, dst string) error {
|
|
in, err := os.Open(src)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer in.Close()
|
|
|
|
out, err := os.Create(dst)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer out.Close()
|
|
|
|
_, err = io.Copy(out, in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|