Port open

SolidGroundUX DocumentationSolidGroundUX
NL

fn: sgnd_port_open

Purpose

Probe a TCP connection to a specified host and port.

Description

Uses nc -z if available; otherwise Bash /dev/tcp.

Arguments

  • $1 — Hostname or IP address.
  • $2 — TCP port number.

Returns

  • 0 when the connection succeeds; non-zero otherwise.

Usage

  sgnd_port_open "localhost" 443