Day to day I need to use ssh port forwarding and connect securely to my work servers. So I decided to create some simple bash script which will allow me to forward port via ssh and to kill previous tunnel if it freezed.
Script source:
#!/bin/bash # irc.sh kill -9 `ps -aef | grep -i 'ssh -f -N -L 1234:127.0.0.1:1234 user@hostname.com' | grep -v grep | awk '{print $2}'` ssh -f -N -L 1234:127.0.0.1:1234 user@hostname.com
My main background for a recent years is MySQL DEV/DBA engineer but I’m also participating in wider range of tasks which could be likely called as DataOps/DevOps tasks. You can see my online CV here: http://catyellow.net