Rsync Mikey & Kent
[clearscm.git] / bin / tunnel
1 #!/bin/bash
2 #
3 # Simple script to use ssh to tunnel ports for SMTP (1025 -> 25) to 
4 # defaria.com so I can read and write email to my home server.
5 #
6 # Note -Nf puts ssh in the background after establishing the tunnel.
7 #
8 # This is for use on Synology only
9 tunnel_running=$(ps -ef | grep ssh | grep defaria.com:25)
10
11 if [ -z "$tunnel_running" ]; then
12   ssh -Nf -L192.168.0.251:1025:defaria.com:25 andrew@defaria.com
13 fi