mirror of
https://github.com/rancher/os.git
synced 2025-09-01 06:40:31 +00:00
Only set rancher password if non-empty
This commit is contained in:
@@ -52,6 +52,7 @@ func consoleInitAction(c *cli.Context) error {
|
||||
}
|
||||
|
||||
password := config.GetCmdline("rancher.password")
|
||||
if password != "" {
|
||||
cmd := exec.Command("chpasswd")
|
||||
cmd.Stdin = strings.NewReader(fmt.Sprint("rancher:", password))
|
||||
if err := cmd.Run(); err != nil {
|
||||
@@ -62,6 +63,7 @@ func consoleInitAction(c *cli.Context) error {
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := setupSSH(cfg); err != nil {
|
||||
log.Error(err)
|
||||
@@ -92,7 +94,7 @@ func consoleInitAction(c *cli.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
cmd = exec.Command("bash", "-c", `echo 'RancherOS \n \l' > /etc/issue`)
|
||||
cmd := exec.Command("bash", "-c", `echo 'RancherOS \n \l' > /etc/issue`)
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user