|
|
@ -3,6 +3,7 @@ package cmd
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"bytes"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"os"
|
|
|
|
"os/exec"
|
|
|
|
"os/exec"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
|
@ -61,9 +62,10 @@ func isAutoresticRunning() bool {
|
|
|
|
|
|
|
|
|
|
|
|
lines := strings.Split(out.String(), "\n")
|
|
|
|
lines := strings.Split(out.String(), "\n")
|
|
|
|
autoresticProcesses := []string{}
|
|
|
|
autoresticProcesses := []string{}
|
|
|
|
|
|
|
|
currentPid := fmt.Sprint(os.Getpid())
|
|
|
|
|
|
|
|
|
|
|
|
for _, line := range lines {
|
|
|
|
for _, line := range lines {
|
|
|
|
if strings.Contains(line, "autorestic") && !strings.Contains(line, "grep autorestic") {
|
|
|
|
if strings.Contains(line, "autorestic") && !strings.Contains(line, "grep autorestic") && !strings.Contains(line, currentPid) {
|
|
|
|
autoresticProcesses = append(autoresticProcesses, line)
|
|
|
|
autoresticProcesses = append(autoresticProcesses, line)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|