Catch SIGTERM.

This commit is contained in:
Solderpunk 2023-03-02 19:30:36 +01:00
parent 641f72a558
commit 1b42ddadfe
1 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import (
"os"
"os/signal"
"strconv"
"syscall"
)
func main() {
@ -63,6 +64,7 @@ func main_body() int {
// Listen for signals to gracefully shutdown
stop := make(chan os.Signal, 1)
signal.Notify(stop, os.Interrupt)
signal.Notify(stop, syscall.SIGTERM)
// Wait for a signal or an error
select {