Skip to content
Snippets Groups Projects
Commit 1e47e709 authored by Schiffer, Christian's avatar Schiffer, Christian
Browse files

Updated atlas_controller scripts to loop until a connection can be established

parent ad621144
No related branches found
No related tags found
No related merge requests found
......@@ -4,4 +4,15 @@
USER=schiffer1
HOST=jureca11.fz-juelich.de
COMMAND='cd /p/home/jusers/schiffer1/jureca/project_jinm16/atlasui/atlas_controller/; source load_modules.sh; source venv/bin/activate; export PYTHONPATH=`pwd`:$PYTHONPATH; python atlas_controller/app.py'
ssh ${USER}@${HOST} -t "bash -cl '${COMMAND}'"
while true
do
echo "Connecting"
ssh ${USER}@${HOST} -t "bash -cl '${COMMAND}'"
retval=$?
# Check for timeout
if [[ ${retval} -ne 0 ]]; then
echo "Could not establish connection to ${HOST}. Will try again in ${RECONNECT} seconds..."
sleep ${RECONNECT}
fi
done
......@@ -3,7 +3,19 @@
USER=schiffer1
HOST=jureca11.fz-juelich.de
RECONNECT=60
echo "Starting SSH tunnel..."
# Make sure tunnel is externally reachable (see https://superuser.com/questions/588591/how-to-make-ssh-tunnel-open-to-public)
ssh ${USER}@${HOST} -N -L \*:8000:localhost:8000
while true
do
# Make sure tunnel is externally reachable (see https://superuser.com/questions/588591/how-to-make-ssh-tunnel-open-to-public)
echo "Connecting"
ssh ${USER}@${HOST} -N -L \*:8000:localhost:8000
retval=$?
# Check for timeout
if [[ ${retval} -ne 0 ]]; then
echo "Could not establish connection to ${HOST}. Will try again in ${RECONNECT} seconds..."
sleep ${RECONNECT}
fi
done
echo "Stopped SSH tunnel"
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