Commit a045f3cd authored by Jonathan Hanks's avatar Jonathan Hanks
Browse files

Bug fixes in remote_epics script.

  * Correctly set IFO/ifo.
  * Fixed the test checking if a command had been passed in to not show an error message.
  * Removed some debug output.
  * Updated help text to show options before site selection.
  * Updated output to delinate when a users command/shell is being run.
  * When running a shell, reset PS1.
parent 1fc3b993
ligo-remote-epics-scripts (0.0.2) stable; urgency=low
* Bug fixes in remote_epics script.
* Correctly set IFO/ifo.
* Fixed the test checking if a command had been passed in to not show an error message.
* Removed some debug output.
* Updated help text to show options before site selection.
-- Jonathan Hanks <jonathan.hanks@ligo.org> Thu, 24 Mar 2016 12:17:47 -0700
ligo-remote-epics-scripts (0.0.1) stable; urgency=low
* Initial release.
......
......@@ -27,7 +27,7 @@ help() {
echo
echo "By default it launches /bin/bash."
echo
echo "Usage: $0 [site] [options] [command]"
echo "Usage: $0 [options] [site] [command]"
echo
echo "Where site is one of LHO or LLO (not case does not matter)"
echo
......@@ -70,13 +70,13 @@ extract_site() {
case "$SITE" in
"LHO")
GATEWAY=lhoepics.ligo-wa.caltech.edu
IFO="h1"
ifo="H1"
IFO="H1"
ifo="h1"
;;
"LLO")
GATEWAY=lloepics.ligo-la.caltech.edu
IFO="l1"
ifo="L1"
IFO="L1"
ifo="l1"
;;
*)
help
......@@ -104,7 +104,7 @@ while getopts ":hu:" OPT; do
;;
esac
done
echo "Args = $@ after parsing"
#echo "Args = $@ after parsing"
extract_site $@
echo "IFO = $IFO"
echo "ifo = $ifo"
......@@ -112,7 +112,7 @@ echo "SITE = $SITE"
echo "site = $site"
echo "GATEWAY = $GATEWAY"
shift 1
echo "Args = $@"
#echo "Args = $@"
SOCKDIR=`mktemp -d "${TMPDIR:-/tmp}"/epics.XXXXXXXXXXXX`
......@@ -121,12 +121,12 @@ if [ $? -ne 0 ]; then
echo "Error setting up for authentication"
exit 1
fi
echo "SOCKDIR=$SOCKDIR"
#echo "SOCKDIR=$SOCKDIR"
SOCK="$SOCKDIR/epics"
# Start a control master, then back ground it after it authenticates
ssh -M -S "$SOCK" -f -N -o "ControlPersist=yes" -l $USERNAME $GATEWAY || exit 1
echo
echo "Connection to $GATEWAY established"
echo "Searching for a free port to use for EPICS CA transport"
echo "The script will randomly select some ports in an attempt to find"
......@@ -172,8 +172,18 @@ LIGO_EPICS_REMOTE_CONNECTION=$SITE
export EPICS_CA_AUTO_ADDR_LIST EPICS_CA_ADDR_LIST EPICS_CA_NAME_SERVERS EPICS_REMOTE_PATH SITE site IFO ifo LIGO_EPICS_REMOTE_CONNECTION
if [ -z "$@" ]; then
echo
if [ -z "$*" ]; then
PS1="remote epics $SITE\$ "
export PS1
echo "Launching bash shell setup to access EPICS at $SITE."
echo "Use the 'exit' command to return to your regular environment."
echo
/bin/bash
else
echo "Connected to EPICS at $SITE"
echo "------------------"
echo
$@
fi
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment