Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JControlHostSSHTunnel.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3#
4# \author mdejong
5#
6version=1.0
7script=${0##*/}
8
9# ------------------------------------------------------------------------------------------
10#
11# Utility script to test JControlHost/JLigier through ssh tunnel.
12#
13# ------------------------------------------------------------------------------------------
14
15
16if [ -z $JPP_DIR ]; then
17 echo "Variable JPP_DIR undefined."
18 exit
19fi
20
21
22source $JPP_DIR/setenv.sh $JPP_DIR
23
24
25set_variable DEBUG 3
26
27if do_usage $*; then
28 usage "$script <host name>"
29fi
30
31case $# in
32 1) set_variable SERVER $1;;
33 *) usage "$script <host name>"
34esac
35
36
37if (( 1 )); then
38
39 set_variable PORT 5553
40 set_variable SOCKET my-ctrl-socket
41
42 JLigier.sh ${SERVER} continue
43
44 echo "Create ssh tunnel."
45
46 ssh -S ${SOCKET} -fN -M 0 -L ${PORT}:${SERVER}:${PORT}
47
48 ./JControlHost -H :${PORT} -d3
49
50 echo "Delete ssh tunnel."
51
52 ssh -S ${SOCKET} -O exit ${SERVER}
53
54fi