Remove the template path if we load the defaults.

This commit is contained in:
Mariano Cano 2020-06-16 17:56:22 -07:00
parent 237baa5169
commit a845b56283

View file

@ -115,9 +115,11 @@ HostKey /etc/ssh/{{.User.Key}}`,
func DefaultTemplates() *Templates {
sshTemplates := DefaultSSHTemplates
for i, t := range sshTemplates.User {
sshTemplates.User[i].TemplatePath = ""
sshTemplates.User[i].Content = []byte(DefaultSSHTemplateData[t.Name])
}
for i, t := range sshTemplates.Host {
sshTemplates.Host[i].TemplatePath = ""
sshTemplates.Host[i].Content = []byte(DefaultSSHTemplateData[t.Name])
}
return &Templates{