Created
October 30, 2020 07:24
-
-
Save ezhov-da/946fb4de0c7ab0156fcb5f9f6d36d93d to your computer and use it in GitHub Desktop.
Проверка доступности TCP
This file contains 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
==> https://www.cyberciti.biz/faq/ping-test-a-specific-port-of-machine-ip-address-using-linux-unix/ | |
## check for tcp port ## | |
## need bash shell ## | |
(echo >/dev/tcp/{host}/{port}) &>/dev/null && echo "open" || echo "close" | |
(echo >/dev/udp/{host}/{port}) &>/dev/null && echo "open" || echo "close" | |
(echo >/dev/tcp/www.cyberciti.biz/22) &>/dev/null && echo "Open 22" || echo "Close 22" | |
(echo >/dev/tcp/www.cyberciti.biz/443) &>/dev/null && echo "Open 443" || echo "Close 443" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment