Compare commits

...

2 Commits

Author SHA1 Message Date
Nicco 6e34196220
Update config.go 2024-03-13 12:40:11 +01:00
Florian dc56911a45
fix(unlock cmd): ignore process if its the current id (#360) 2024-03-13 12:39:51 +01:00
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package cmd
import (
"bytes"
"fmt"
"os"
"os/exec"
"strings"
@ -61,9 +62,10 @@ func isAutoresticRunning() bool {
lines := strings.Split(out.String(), "\n")
autoresticProcesses := []string{}
currentPid := fmt.Sprint(os.Getpid())
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)
}
}

View File

@ -17,7 +17,7 @@ import (
"github.com/spf13/viper"
)
const VERSION = "1.8.0"
const VERSION = "1.8.1"
type OptionMap map[string][]interface{}
type Options map[string]OptionMap