Index: /trunk/Frameshare-SSH-tunnelling.txt
===================================================================
--- /trunk/Frameshare-SSH-tunnelling.txt	(revision 867)
+++ /trunk/Frameshare-SSH-tunnelling.txt	(revision 868)
@@ -8,4 +8,5 @@
 Scripts for Expeditee are in dev/bin/script
 
+Edit "Frameshare-SSH-Tunnel-CONFIG.sh" to set the server port, SSH username and host
 Run "Frameshare-SSH-Tunnel-Client.sh" on the machine that you're running the Expeditee window on
 Run "Frameshare-SSH-Tunnel-Server.sh" on the machine that the Expeditee frameserver is running on (only needs to be run once and it should support all users)
Index: /trunk/dev/bin/script/Frameshare-SSH-Tunnel-CONFIG.sh
===================================================================
--- /trunk/dev/bin/script/Frameshare-SSH-Tunnel-CONFIG.sh	(revision 868)
+++ /trunk/dev/bin/script/Frameshare-SSH-Tunnel-CONFIG.sh	(revision 868)
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# If you don't have public-key authentication set up for your SSH login,
+# You won't be able to use this script, because the SSH connections won't be able to login automatically
+# So either set up public-key authentication, or you can manually start every SSH tunnel and login
+
+# You should change the username and hostname to your own username and the hostname of your server
+username=jts21
+hostname=toro.cms.waikato.ac.nz
+# You should change the port to the port of your server (leave it at 3000 if not sure)
+port=3000
+
+# ----------------------------------------------------#
+# NOTHING BELOW THIS POINT SHOULD NEED TO BE MODIFIED #
+# ----------------------------------------------------#
+
+# get the offseted port values
+frameserverPort=$port
+framesaverPort=$((port+1))
+messagePort=$((port+2))
+infserverPort=$((port+3))
+infupdatePort=$((port+4))
+imageserverPort=$((port+5))
+imagesaverPort=$((port+6))
+
+# get the jar file for UDPTunnel
+jarFile=$(dirname $0)/../UDPTunnel.jar
Index: /trunk/dev/bin/script/Frameshare-SSH-Tunnel-Client.sh
===================================================================
--- /trunk/dev/bin/script/Frameshare-SSH-Tunnel-Client.sh	(revision 867)
+++ /trunk/dev/bin/script/Frameshare-SSH-Tunnel-Client.sh	(revision 868)
@@ -1,32 +1,15 @@
 #!/bin/bash
 
-# IMPORTANT:
+trap ctrl_c INT
 
-# This script does NOT close cleanly,
-# the SSH tunnels will be left active after the script exits!
+function ctrl_c() {
+	echo -e "\nExiting"
+	# clean up the SSH tunnels
+	jobs -p | xargs kill
+	exit 0
+}
 
-# If you don't have public-key authentication set up for your SSH login,
-# You won't be able to use this script, because the SSH connections won't be able to login automatically
-# So either set up public-key authentication, or you can manually start every SSH tunnel and login
-
-# You should change the username and hostname to your own username and the hostname of your server
-username=jts21
-hostname=toro.cms.waikato.ac.nz
-# You should change the port to the port of your server (leave it at 3000 if not sure)
-port=3000
-
-# ---------------------------------------------------
-# NOTHING BELOW THIS POINT SHOULD NEED TO BE MODIFIED
-# ---------------------------------------------------
-
-# get the offseted port values
-frameserverPort=$port
-framesaverPort=$((port+1))
-messagePort=$((port+2))
-infserverPort=$((port+3))
-infupdatePort=$((port+4))
-imageserverPort=$((port+5))
-imagesaverPort=$((port+6))
-
+# load config
+. $(dirname $0)/Frameshare-SSH-Tunnel-CONFIG.sh
 
 # setup ssh tunnels
@@ -41,3 +24,3 @@
 sleep 1
 # tunnel udp connections through their equivalent tcp ports
-java UDPTunnel client $frameserverPort $framesaverPort $messagePort $infserverPort $infupdatePort
+java -jar $jarFile client $frameserverPort $framesaverPort $messagePort $infserverPort $infupdatePort
Index: /trunk/dev/bin/script/Frameshare-SSH-Tunnel-Server.sh
===================================================================
--- /trunk/dev/bin/script/Frameshare-SSH-Tunnel-Server.sh	(revision 867)
+++ /trunk/dev/bin/script/Frameshare-SSH-Tunnel-Server.sh	(revision 868)
@@ -1,20 +1,7 @@
 #!/bin/bash
 
-# You should change the port to the port of your server (leave it at 3000 if not sure)
-port=3000
-
-# ---------------------------------------------------
-# NOTHING BELOW THIS POINT SHOULD NEED TO BE MODIFIED
-# ---------------------------------------------------
-
-# get the offseted port values
-frameserverPort=$port
-framesaverPort=$((port+1))
-messagePort=$((port+2))
-infserverPort=$((port+3))
-infupdatePort=$((port+4))
-imageserverPort=$((port+5))
-imagesaverPort=$((port+6))
+# load config
+. $(dirname $0)/Frameshare-SSH-Tunnel-CONFIG.sh
 
 # tunnel udp connections through their equivalent tcp ports
-java UDPTunnel server $frameserverPort $framesaverPort $messagePort $infserverPort $infupdatePort
+java -jar $jarFile server $frameserverPort $framesaverPort $messagePort $infserverPort $infupdatePort
