Created
December 17, 2025 13:20
-
-
Save scolton99/2fc28a879a84cda3845f389be64d5a14 to your computer and use it in GitHub Desktop.
Test TCP port (headless)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| HOST=fqdn.example.com | |
| PORT=8000 | |
| nc -z -w 5 "$HOST" "$PORT" && echo "Do this if the port is OPEN" || echo "Do this if the port is CLOSED" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment