- Run without console by default - Log to file once console hidden - Recover panics in background goroutines - Restart agent after unexpected errors - Use shared instance launch helper
20 lines
297 B
Go
20 lines
297 B
Go
package instance
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"tea.chunkbyte.com/kato/go-worm/lib/config"
|
|
)
|
|
|
|
func Detach() error {
|
|
if AlreadyRunning() {
|
|
return fmt.Errorf("agent already running")
|
|
}
|
|
exe, err := config.InstalledExe()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return Launch(exe, filterArgs(os.Args[1:]))
|
|
}
|