37 lines
519 B
Go
37 lines
519 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"mpbl3p/config"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
)
|
|
|
|
func main() {
|
|
log.SetFlags(log.Ldate | log.Ltime | log.Llongfile)
|
|
|
|
log.Println("loading config...")
|
|
|
|
c, err := config.LoadConfig("config.ini")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
log.Println("building config...")
|
|
p, err := c.Build()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
log.Println("starting...")
|
|
p.Start()
|
|
|
|
log.Println("running")
|
|
|
|
signals := make(chan os.Signal)
|
|
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT)
|
|
|
|
<-signals
|
|
}
|