source: trunk/dev/bin/script/Frameshare-SSH-Tunnel-Client.sh@ 867

Last change on this file since 867 was 867, checked in by jts21, 10 years ago

Add scripts for tunnelling a frameserver connection over SSH

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#!/bin/bash
2
3# IMPORTANT:
4
5# This script does NOT close cleanly,
6# the SSH tunnels will be left active after the script exits!
7
8# If you don't have public-key authentication set up for your SSH login,
9# You won't be able to use this script, because the SSH connections won't be able to login automatically
10# So either set up public-key authentication, or you can manually start every SSH tunnel and login
11
12# You should change the username and hostname to your own username and the hostname of your server
13username=jts21
14hostname=toro.cms.waikato.ac.nz
15# You should change the port to the port of your server (leave it at 3000 if not sure)
16port=3000
17
18# ---------------------------------------------------
19# NOTHING BELOW THIS POINT SHOULD NEED TO BE MODIFIED
20# ---------------------------------------------------
21
22# get the offseted port values
23frameserverPort=$port
24framesaverPort=$((port+1))
25messagePort=$((port+2))
26infserverPort=$((port+3))
27infupdatePort=$((port+4))
28imageserverPort=$((port+5))
29imagesaverPort=$((port+6))
30
31
32# setup ssh tunnels
33ssh -NL $frameserverPort:localhost:$frameserverPort ${username}@${hostname} &
34ssh -NL $framesaverPort:localhost:$framesaverPort ${username}@${hostname} &
35ssh -NL $messagePort:localhost:$messagePort ${username}@${hostname} &
36ssh -NL $infserverPort:localhost:$infserverPort ${username}@${hostname} &
37ssh -NL $infupdatePort:localhost:$infupdatePort ${username}@${hostname} &
38ssh -NL $imageserverPort:localhost:$imageserverPort ${username}@${hostname} &
39ssh -NL $imagesaverPort:localhost:$imagesaverPort ${username}@${hostname} &
40# give the ssh instances time to connect
41sleep 1
42# tunnel udp connections through their equivalent tcp ports
43java UDPTunnel client $frameserverPort $framesaverPort $messagePort $infserverPort $infupdatePort
Note: See TracBrowser for help on using the repository browser.