MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadSSHManagedBlockFromFile

Function loadSSHManagedBlockFromFile

agent/app/service/ssh.go:1168–1178  ·  view source on GitHub ↗
(fileName string)

Source from the content-addressed store, hash-verified

1166}
1167
1168func loadSSHManagedBlockFromFile(fileName string) (sshManagedBlock, error) {
1169 content, err := os.ReadFile(fileName)
1170 if err != nil {
1171 return sshManagedBlock{}, err
1172 }
1173 block, ok := loadSSHManagedBlock(strings.Split(string(content), "\n"))
1174 if !ok {
1175 return sshManagedBlock{}, nil
1176 }
1177 return block, nil
1178}
1179
1180func insertSSHDirectivesAt(lines []string, insertAt int, directives []string) []string {
1181 newLines := make([]string, 0, len(lines)+len(directives))

Callers 2

Calls 1

loadSSHManagedBlockFunction · 0.85

Tested by

no test coverage detected