Made the service into a daemon that you can route IPC commands to
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@@ -107,6 +108,10 @@ func (pm *ProcessManager) SendCommand(name string, command string) error {
|
||||
return fmt.Errorf("Cannot send command, instance with name '%s' is not running", name)
|
||||
}
|
||||
|
||||
if command != "" && !strings.HasPrefix(command, "/") {
|
||||
command = "/" + command
|
||||
}
|
||||
|
||||
_, err := io.WriteString(pipe, command+"\n")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed writing to server process stdin conduit: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user