MQTTListener/main.go

35 lines
437 B
Go
Raw Normal View History

2020-08-26 09:54:26 +02:00
package main
import (
"mqttListener/Config"
"mqttListener/mqtt"
//"mqttListener/cmd"
//"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
Config.ReadConfig()
// DEBUG Config
// fmt.Println("BrokerAddress = ", Config.BrokerAddress)
mqtt.Setup()
mqtt.Connect()
go mqtt.Listen()
//cmd.Exec()
<-c // wait for SIGTERM
mqtt.Disconnect()
}