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

Function disableSSHSocket

agent/app/service/ssh.go:168–180  ·  view source on GitHub ↗
(serviceName string, stopActive bool)

Source from the content-addressed store, hash-verified

166}
167
168func disableSSHSocket(serviceName string, stopActive bool) error {
169 if stopActive {
170 if err := stopSSHSocketIfActive(serviceName); err != nil {
171 return err
172 }
173 }
174 for _, socketName := range loadSSHSocketNames(serviceName) {
175 if err := controller.Handle("disable", socketName); err != nil {
176 return fmt.Errorf("disable %s failed, err: %v", socketName, err)
177 }
178 }
179 return nil
180}
181
182func loadSSHSocketNames(serviceName string) []string {
183 baseName := strings.TrimSuffix(serviceName, ".service")

Callers 1

OperateSSHMethod · 0.85

Calls 2

stopSSHSocketIfActiveFunction · 0.85
loadSSHSocketNamesFunction · 0.85

Tested by

no test coverage detected