diff --git a/generate/authorized_keys/generate_authorized_keys.go b/generate/authorized_keys/generate_authorized_keys.go index 10cd48d..885058a 100644 --- a/generate/authorized_keys/generate_authorized_keys.go +++ b/generate/authorized_keys/generate_authorized_keys.go @@ -22,9 +22,7 @@ func Run(data []byte) { check(err) for i := 0; i < len(hosts.Hosts); i++ { fmt.Print("command=\"borg serve --restrict-to-path ") - fmt.Print(hosts.Folder) - fmt.Print("/") - fmt.Print(hosts.Hosts[i].Name) + fmt.Print(hosts.TotalPath(i)) if (hosts.Hosts[i].AppendOnly) { fmt.Print(" --append only") } @@ -34,8 +32,8 @@ func Run(data []byte) { } } -func (*HostList) TotalPath(index int) string { - +func (hostList *HostList) TotalPath(index int) string { + return hostList.Folder + "/" + hostList.Hosts[index].Name } func check(e error) { if e != nil {