Files
go-worm/lib/instance/ensure.go
T

19 lines
385 B
Go
Raw Normal View History

package instance
import (
"tea.chunkbyte.com/kato/go-worm/lib/config"
)
// EnsureRunning starts this host's agent if none is holding the mutex.
// Callers that can stay resident should run the agent in-process instead.
func EnsureRunning() error {
if AlreadyRunning() {
return nil
}
exe, err := config.InstalledExe()
if err != nil {
return err
}
return Launch(exe, nil)
}