Add buttons to core upgrade notification

This commit is contained in:
Daniel
2020-07-21 16:56:45 +02:00
parent 9bc3f95e9e
commit bdf2d025b1
2 changed files with 33 additions and 2 deletions

View File

@@ -32,15 +32,19 @@ func registerEventHooks() error {
return nil
}
// shutdown shuts the Portmaster down.
func shutdown(ctx context.Context, _ interface{}) error {
log.Warning("core: user requested shutdown")
// Do not use a worker, as this would block itself here.
go modules.Shutdown() //nolint:errcheck
return nil
}
// restart restarts the Portmaster.
func restart(ctx context.Context, data interface{}) error {
log.Info("core: user requested restart")
modules.SetExitStatusCode(restartCode)
// Do not use a worker, as this would block itself here.
go modules.Shutdown() //nolint:errcheck
return nil
}