1
0
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:
Josh Curl
2016-12-08 15:22:43 -08:00
parent f1f41dffa2
commit 328bd5bd2e

View File

@@ -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)
}