Skip to content
Snippets Groups Projects
Commit 715c0dec authored by Marcel Loose's avatar Marcel Loose :sunglasses:
Browse files

Task #2744: Moved startPython.sh script from Operations repository to LOFAR repository

parent 61ff9cf0
No related branches found
No related tags found
No related merge requests found
#!/bin/bash -l
#
# This script is started by the MAC Python Controller using the following
# parameters:
#
# <pythonProgram> <parsetname> <3 fields with communication settings>
#
# For example:
#
# startPython.sh ./pythonProgram /opt/lofar/share/Observation6118 \
# MCU001T MCU001T:PythonControl[0]{6118}:listener \
# PythonServer{6118}@MCU001T
#
# For the time being, we will ignore the 3 communication settings, because
# we will not be under control of MAC yet.
#
# Make sure aliases are expanded, which is not the default for non-interactive
# shells.
shopt -s expand_aliases
# Enable debugging messages
debug=on
usage()
{
echo "Usage: $0 <pythonProgram> <parsetname> <MAC-Python-control-host> \\"
echo " <MAC-Python-control-listener> <MAC-Python-control-server>"
exit 1
}
error()
{
echo "ERROR: $@" 1>&2
exit 1
}
# Check for correct number of input arguments.
[ $# -eq 5 ] || usage
pythonProgram="$1"
parsetFile="$2"
# Initialize the environment. We will assume here that we can use the
# Lofar Login Environment (LLE).
use LofIm
# Print some debugging information if debugging is enabled.
if [ -n "$debug" ]; then
echo "PATH=${PATH}"
echo "PYHONTPATH=${PYTHONPATH}"
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
fi
# Start the Python program.
python "${pythonProgram}" "${parsetFile}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment