Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JControlHostSSHTunnel.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #
4 # \author mdejong
5 #
6 version=1.0
7 script=${0##*/}
8 
9 # ------------------------------------------------------------------------------------------
10 #
11 # Utility script to test JControlHost/JLigier through ssh tunnel.
12 #
13 # ------------------------------------------------------------------------------------------
14 
15 
16 if [ -z $JPP_DIR ]; then
17  echo "Variable JPP_DIR undefined."
18  exit
19 fi
20 
21 
22 source $JPP_DIR/setenv.sh $JPP_DIR
23 
24 
26 
27 if ( do_usage $* ); then
28  usage "$script <host name>"
29 fi
30 
31 case $# in
32  1) SERVER=$1;;
33  *) usage "$script <host name>"
34 esac
35 
36 
37 if (( 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 
54 fi
static const double H
Planck constant [eV s].
Definition: JConstants.hh:25
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
exit
Definition: JPizza.sh:36
then echo
* usage
do set_variable SIGMA_NS set_variable OUTLIERS set_variable OUTPUT_FILE matrix[${ALPHA_DEG}\deg\] root $JPP JMatrixNZ a $DETECTOR f $INPUT_FILE o $OUTPUT_FILE S
Definition: JMatrixNZ.sh:56
then echo Launching message logger in new window xterm geometry e JGetMessage H $HOST T $TAG d3
version
Definition: JCalibratePMT.sh:7
then usage $script fi SERVER
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62