diff --git a/cmd/wrench/main.go b/cmd/wrench/main.go index 09ca964..b0e7d79 100644 --- a/cmd/wrench/main.go +++ b/cmd/wrench/main.go @@ -76,7 +76,7 @@ func main () { delUserCommand := flag.NewFlagSet("deluser", flag.ExitOnError) delUserService := delUserCommand.String ("s", "router", "Service to delete the user for") - delUserRmData := delUserCommand.Bool ("rmd", false, + delUserRmData := delUserCommand.Bool ("D", false, "Whether to remove the service's data directory") authCommand := flag.NewFlagSet("auth", flag.ExitOnError) @@ -153,13 +153,15 @@ func execAdduser (service string) { addgroup, _ := exec.LookPath("addgroup") tryCommand (exec.Command(addgroup, fullName, "-S"), "could not add group") - tryCommand (exec.Command(adduser, fullName, "-SHDG", fullName), + tryCommand (exec.Command ( + adduser, fullName, "-SHDG", fullName, "-h", dataDir), "could not add user") } else if useradd, err := exec.LookPath("useradd"); err == nil { // GNU tryCommand (exec.Command ( useradd, fullName, "-rUM", - "--shell", "/sbin/nologin"), "could not add user") + "--shell", "/sbin/nologin", + "-d", dataDir), "could not add user") } else { cli.Sayf("could not add user: no command adduser or useradd\n") os.Exit(1)