sahd;ljasl;dkj
This commit is contained in:
parent
7726d732d4
commit
1978e263d6
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user