Fixed the ctl + c exit

The removal of electron was a bit too expeditious and removed
some of the things that controled the exit of the system

Change-Id: I8ad1ab83fc3ecbcbe07bdd949bc01fd8a0889e00
This commit is contained in:
Schiefelbein, Andrew 2020-07-31 08:48:13 -05:00
parent 8cd169351f
commit d1a0509bf0

View File

@ -80,7 +80,14 @@ func launch(cmd *cobra.Command, args []string) {
webservice.SendAlert(configs.Info, fmt.Sprintf("%s", err), true)
}
// start the web service and related sundries
// start webservice and listen for the the ctl + c to exit
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
<-c
log.Println("Exiting the webservice")
os.Exit(0)
}()
webservice.WebServer()
// cancel running plugins and wait for shut down