printBanner prints the generated opencloud config banner.
(targetPath, ocAdminServicePassword string, adminPWgenerated bool, targetBackupConfig string)
| 48 | |
| 49 | // printBanner prints the generated opencloud config banner. |
| 50 | func printBanner(targetPath, ocAdminServicePassword string, adminPWgenerated bool, targetBackupConfig string) { |
| 51 | fmt.Printf( |
| 52 | "\n=========================================\n"+ |
| 53 | " generated OpenCloud Config\n"+ |
| 54 | "=========================================\n"+ |
| 55 | " configpath : %s\n", |
| 56 | targetPath, |
| 57 | ) |
| 58 | if adminPWgenerated { |
| 59 | fmt.Printf(" user : admin\n"+ |
| 60 | " password : %s\n", |
| 61 | ocAdminServicePassword, |
| 62 | ) |
| 63 | } |
| 64 | fmt.Println() |
| 65 | |
| 66 | if targetBackupConfig != "" { |
| 67 | fmt.Printf("\n=========================================\n"+ |
| 68 | "An older config file has been backed up to\n %s\n\n", |
| 69 | targetBackupConfig) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | // writeConfig writes the config to the target path and prints a banner |
| 74 | func writeConfig(configPath, ocAdminServicePassword, targetBackupConfig string, yamlOutput []byte, adminPWgenerated, quiet bool) error { |