Makefile and agent start.
This commit is contained in:
30
agent/main.go
Normal file
30
agent/main.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"kattila-agent/api"
|
||||
"kattila-agent/config"
|
||||
"kattila-agent/reporter"
|
||||
"kattila-agent/security"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.Println("Kattila Agent starting...")
|
||||
|
||||
config.LoadConfig()
|
||||
security.StartKeyPoller()
|
||||
|
||||
api.StartServer(reporter.HandleRelay)
|
||||
reporter.StartLoop()
|
||||
|
||||
// Wait for termination signal
|
||||
sigChan := make(chan os.Signal, 1)
|
||||
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
|
||||
<-sigChan
|
||||
|
||||
log.Println("Kattila Agent shutting down...")
|
||||
}
|
||||
Reference in New Issue
Block a user