I don't know anything about ssh (or bash) but I'm opening a tunnel like this (random IP's in my example):
ssh -L50000:120.134.4.156:50000 cadmin@34.564.234.64 -g
How can I
- Check from another terminal that the tunnel is open and if it's closed/non existent open it.
- Close the tunnel from another terminal if tunnel is open.
I have been reading here but I don't know how to use this answer: ssh: check if a tunnel is alive
Thanks for all help, Cris