(echo >/dev/tcp/[FQDN]/[port]) &>/dev/null && echo “open” || echo “close”
Test it.
Open in one terminal port (in example 8081) with
nc -l 8081
In second terminal
cat > /dev/tcp/localhost/8081
margusja@IRack:~$ cat </dev/tcp/[ssh server]/22
SSH-2.0-OpenSSH_7.4