X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=bin%2Ftunnel;h=06019c072f36c7e46fdef158fd17e0d12c5aaf72;hb=7103b16938d37a059a79e99c3bf7058687247658;hp=2925093903383c6874a0370220f45df1fb639da2;hpb=64cb05c445d480f29d266e70db6eb1d021d34456;p=clearscm.git diff --git a/bin/tunnel b/bin/tunnel index 2925093..06019c0 100755 --- a/bin/tunnel +++ b/bin/tunnel @@ -1,7 +1,13 @@ #!/bin/bash # -# Simple script to use ssh to tunnel ports for IMAP (1143 -> 143) and SMTP (1025 -> 25) -# to defaria.com so I can read and write email to my home server. +# Simple script to use ssh to tunnel ports for SMTP (1025 -> 25) to +# defaria.com so I can read and write email to my home server. # # Note -Nf puts ssh in the background after establishing the tunnel. -ssh -Nf -L localhost:1025:defaria.com:25 -L localhost:1143:defaria.com:143 andrew@defaria.com +# +# This is for use on Synology only +tunnel_running=$(ps -ef | grep ssh | grep defaria.com:25) + +if [ -z "$tunnel_running" ]; then + ssh -Nf -L192.168.0.251:1025:defaria.com:25 andrew@defaria.com +fi