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

Function loadSSHManagedBlock

agent/app/service/ssh.go:1151–1166  ·  view source on GitHub ↗
(lines []string)

Source from the content-addressed store, hash-verified

1149}
1150
1151func loadSSHManagedBlock(lines []string) (sshManagedBlock, bool) {
1152 for index, line := range lines {
1153 if strings.TrimSpace(line) != sshManagedMarker {
1154 continue
1155 }
1156 end := len(lines)
1157 for next := index + 1; next < len(lines); next++ {
1158 if strings.HasPrefix(strings.ToLower(strings.TrimSpace(lines[next])), "match ") {
1159 end = next
1160 break
1161 }
1162 }
1163 return sshManagedBlock{Start: index + 1, End: end}, true
1164 }
1165 return sshManagedBlock{}, false
1166}
1167
1168func loadSSHManagedBlockFromFile(fileName string) (sshManagedBlock, error) {
1169 content, err := os.ReadFile(fileName)

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected