MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / checkSSHPortReachable

Function checkSSHPortReachable

internal/ui/plugins/ansible/plugin.go:1490–1500  ·  view source on GitHub ↗
(target string, timeout time.Duration)

Source from the content-addressed store, hash-verified

1488}
1489
1490func checkSSHPortReachable(target string, timeout time.Duration) bool {
1491 if strings.TrimSpace(target) == "" {
1492 return false
1493 }
1494 conn, err := net.DialTimeout("tcp", net.JoinHostPort(target, "22"), timeout)
1495 if err != nil {
1496 return false
1497 }
1498 _ = conn.Close()
1499 return true
1500}
1501
1502func boolPtr(v bool) *bool {
1503 return &v

Callers 1

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected