diff --git a/main.go b/main.go index c7ee03c..070f097 100644 --- a/main.go +++ b/main.go @@ -9,12 +9,14 @@ import ( "sort" "strings" "sync" + "sync/atomic" "time" "9fans.net/go/acme" ) var ollie string +var exiting atomic.Bool func init() { ollie = os.Getenv("OLLIE") @@ -24,6 +26,9 @@ func init() { } func remount() { + if exiting.Load() { + return + } exec.Command("ollie-remount").Run() //nolint:errcheck } @@ -164,6 +169,7 @@ func (sl *sessionList) eventLoop() { sl.win.WriteEvent(e) } } + exiting.Store(true) os.Exit(0) }