Make systray block until graceful shutdown finishes

This commit is contained in:
idk
2022-02-19 00:46:47 -05:00
parent c17b38f8e6
commit 789e2d6d94
4 changed files with 88 additions and 0 deletions

12
main.go
View File

@ -16,6 +16,8 @@ import (
"github.com/itchio/headway/state"
tbget "i2pgit.org/idk/i2p.plugins.tor-manager/get"
tbserve "i2pgit.org/idk/i2p.plugins.tor-manager/serve"
"github.com/eyedeekay/go-I2P-jpackage"
)
/*
@ -162,6 +164,16 @@ func main() {
}
}
} else {
I2Pdaemon, err := I2P.NewDaemon(*directory, false)
if err != nil {
log.Println(err)
return
}
if err = I2Pdaemon.Start(); err != nil {
log.Fatal(err)
}
shutdown = true
defer I2Pdaemon.Stop()
go runSysTray(true)
if tbget.TestHTTPDefaultProxy() {
log.Println("I2P HTTP proxy OK")