ssh: check if a tunnel is alive May 14, 2023 by Tarik Netcat is your friend: nc -z localhost 6000 || echo "no tunnel open"