2021-01-12 06:32:00 +00:00
|
|
|
package main
|
|
|
|
|
2021-03-27 19:21:52 +00:00
|
|
|
// env CGO_ENABLED=0 go build -ldflags "-s -w" -o nats-api
|
2021-01-16 00:01:31 +00:00
|
|
|
|
2021-01-12 06:32:00 +00:00
|
|
|
import (
|
2021-01-12 21:14:43 +00:00
|
|
|
"flag"
|
2021-01-15 18:21:25 +00:00
|
|
|
"fmt"
|
2021-01-12 21:14:43 +00:00
|
|
|
|
2021-01-12 06:32:00 +00:00
|
|
|
"github.com/wh1te909/tacticalrmm/natsapi"
|
|
|
|
)
|
|
|
|
|
2021-07-17 07:16:38 +00:00
|
|
|
var version = "2.2.0"
|
2021-01-15 18:21:25 +00:00
|
|
|
|
2021-01-12 06:32:00 +00:00
|
|
|
func main() {
|
2021-01-15 18:21:25 +00:00
|
|
|
ver := flag.Bool("version", false, "Prints version")
|
2021-03-27 19:21:52 +00:00
|
|
|
mode := flag.String("m", "", "Mode")
|
|
|
|
config := flag.String("c", "", "config file")
|
2021-01-12 21:14:43 +00:00
|
|
|
flag.Parse()
|
|
|
|
|
2021-01-15 18:21:25 +00:00
|
|
|
if *ver {
|
|
|
|
fmt.Println(version)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-03-27 19:21:52 +00:00
|
|
|
switch *mode {
|
|
|
|
case "wmi":
|
|
|
|
api.GetWMI(*config)
|
2021-06-27 06:23:37 +00:00
|
|
|
case "checkin":
|
|
|
|
api.CheckIn(*config)
|
2021-07-17 05:13:40 +00:00
|
|
|
case "agentinfo":
|
|
|
|
api.AgentInfo(*config)
|
2021-06-27 06:23:37 +00:00
|
|
|
default:
|
|
|
|
fmt.Println(version)
|
2021-03-27 19:21:52 +00:00
|
|
|
}
|
2021-01-12 06:32:00 +00:00
|
|
|
}
|