parent
9d030f38b7
commit
d2e5692694
4
app.go
4
app.go
|
@ -187,22 +187,18 @@ func askUsernamePasswordIfPossible() error {
|
||||||
trace("File %s exists, won't ask for password", configfile)
|
trace("File %s exists, won't ask for password", configfile)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if !terminal.IsTerminal(int(os.Stdin.Fd())) {
|
if !terminal.IsTerminal(int(os.Stdin.Fd())) {
|
||||||
return nil // do nothing
|
return nil // do nothing
|
||||||
}
|
}
|
||||||
trace("stdin is a terminal")
|
|
||||||
if !terminal.IsTerminal(int(os.Stdout.Fd())) {
|
if !terminal.IsTerminal(int(os.Stdout.Fd())) {
|
||||||
return nil // do nothing
|
return nil // do nothing
|
||||||
}
|
}
|
||||||
trace("stdout is a terminal")
|
|
||||||
fmt.Printf("Would you like to set user/password for the web interface authentication (yes/no)?\n")
|
fmt.Printf("Would you like to set user/password for the web interface authentication (yes/no)?\n")
|
||||||
yesno, err := promptAndGet("Please type 'yes' or 'no': ")
|
yesno, err := promptAndGet("Please type 'yes' or 'no': ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if yesno[0] != 'y' && yesno[0] != 'Y' {
|
if yesno[0] != 'y' && yesno[0] != 'Y' {
|
||||||
trace("User didn't want password, exiting")
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
username, err := promptAndGet("Please enter the username: ")
|
username, err := promptAndGet("Please enter the username: ")
|
||||||
|
|
Loading…
Reference in New Issue