Rewrite shell signal handling

This commit is contained in:
Alexey Khit
2023-05-20 06:29:14 +03:00
parent e29307125c
commit 82a8e07b66
5 changed files with 59 additions and 48 deletions

10
main.go
View File

@@ -28,9 +28,7 @@ import (
"github.com/AlexxIT/go2rtc/internal/tapo"
"github.com/AlexxIT/go2rtc/internal/webrtc"
"github.com/AlexxIT/go2rtc/internal/webtorrent"
"os"
"os/signal"
"syscall"
"github.com/AlexxIT/go2rtc/pkg/shell"
)
func main() {
@@ -66,9 +64,5 @@ func main() {
ngrok.Init()
debug.Init()
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
<-sigs
println("exit OK")
shell.RunUntilSignal()
}