32 lines
463 B
Go
32 lines
463 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"os"
|
||
|
"os/signal"
|
||
|
"syscall"
|
||
|
|
||
|
"git.nemunai.re/nemunaire/reveil/config"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
Version = "custom-build"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
cfg, err := config.Consolidated()
|
||
|
if err != nil {
|
||
|
log.Fatal("Unable to read configuration:", err)
|
||
|
}
|
||
|
|
||
|
a := NewApp(cfg)
|
||
|
go a.Start()
|
||
|
|
||
|
quit := make(chan os.Signal, 1)
|
||
|
signal.Notify(quit, os.Interrupt, syscall.SIGTERM)
|
||
|
<-quit
|
||
|
log.Println("Stopping the service...")
|
||
|
a.Stop()
|
||
|
log.Println("Stopped")
|
||
|
}
|