|
|
|
@ -8,6 +8,7 @@ import ( |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"errors" |
|
|
|
"errors" |
|
|
|
"lcthw.dev/go/ttarpit/config" |
|
|
|
"lcthw.dev/go/ttarpit/config" |
|
|
|
|
|
|
|
"sync" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func LaunchLogger(in io.Reader, out io.Writer, err error) { |
|
|
|
func LaunchLogger(in io.Reader, out io.Writer, err error) { |
|
|
|
@ -52,6 +53,8 @@ func LaunchProcess(proc *config.Process) { |
|
|
|
func main() { |
|
|
|
func main() { |
|
|
|
config.Load() |
|
|
|
config.Load() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var wg sync.WaitGroup |
|
|
|
|
|
|
|
|
|
|
|
fmt.Println("CONFIG:", config.Settings.ConfigPath) |
|
|
|
fmt.Println("CONFIG:", config.Settings.ConfigPath) |
|
|
|
fmt.Println("COMMANDs:", config.Settings.Processes) |
|
|
|
fmt.Println("COMMANDs:", config.Settings.Processes) |
|
|
|
|
|
|
|
|
|
|
|
@ -59,8 +62,11 @@ func main() { |
|
|
|
fmt.Println("PROCESS:", name) |
|
|
|
fmt.Println("PROCESS:", name) |
|
|
|
|
|
|
|
|
|
|
|
proc.Ready = make(chan string) |
|
|
|
proc.Ready = make(chan string) |
|
|
|
go LaunchProcess(&proc) |
|
|
|
wg.Go(func() { |
|
|
|
|
|
|
|
LaunchProcess(&proc) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fmt.Println("WAITING....") |
|
|
|
|
|
|
|
wg.Wait() |
|
|
|
} |
|
|
|
} |
|
|
|
|