How do I know if my ssh tunnel is created successfully?

view full story

http://unix.stackexchange.com – I rely on the following script tunnel.sh written by others to keep a ssh tunnel alive: #!/bin/bash export SSH_HOST=tim@server if [ ! -f /tmp/.tunnel ] then echo "Creat SSH tunnel" ssh -f -D 9999 $SSH_HOST "if [ -f ~/.tunnel ]; then rm ~/.tunnel; fi; while [ ! -f ~/.tunnel ]; do echo > /dev/null; done" & touch /tmp/.tunnel else echo "Close SSH tunnel" ssh $SSH_HOST "touch ~/.tunnel" rm /tmp/.tunnel fi exit To create a persistent ssh tunnel, I just issue `tunnel.sh. The tunnel will not be closed until I issue tunnel.sh again. I was wondering how I can verify if the ssh tunnel i (HowTos)