#!/bin/bash # 1. FIND THIS SCRIPT PATH #Next lines just finds the path of the file #Works for all versions,including #when called via multple depth soft link, #when script called by command "source" aka . (dot) operator. #when arg $0 is modified from caller. #"./script" "/full/path/to/script" "/some/path/../../another/path/script" "./some/folder/script" #RCDBWWW_SCRIPT_PATH is given in full path, no matter how it is called. #Just make sure you locate this at start of the script. RCDBWWW_SCRIPT_PATH="${BASH_SOURCE[0]}"; if([ -h "${RCDBWWW_SCRIPT_PATH}" ]) then while([ -h "${RCDBWWW_SCRIPT_PATH}" ]) do RCDBWWW_SCRIPT_PATH=`readlink "${RCDBWWW_SCRIPT_PATH}"`; done fi pushd . > /dev/null cd `dirname ${RCDBWWW_SCRIPT_PATH}` > /dev/null RCDBWWW_SCRIPT_PATH=`pwd`; popd > /dev/null # 2. IS ENVIRONMENT SET? if [ -z "$RCDB_HOME" ]; then source $RCDBWWW_SCRIPT_PATH/daq_environment.bash fi if [ -z "$RCDB_CONNECTION" ]; then source $RCDBWWW_SCRIPT_PATH/daq_environment.bash fi # 3. START WWW echo "This script starts http server on local port that shows RCDB GUI" echo "If you connect to online machines over SSH there are several options how to view it:" echo echo "1. Over X11. It could be slow (but could be not). run: " echo " firefox -no-remote http://127.0.0.1:5000" echo echo "2. By bizare tunneling. Open the the link in a local browser after something like:" echo " ssh -X -L5000:localhost:5000 login.jlab.org -t ssh -X -L5000:localhost:5000 hallgw -t ssh -L5000:localhost:5000 gluon49" echo echo "3. By VNC. Shouldn't be any problems" echo python $RCDB_HOME/start_www.py