Skip to content
Snippets Groups Projects
Commit 0ebc4d62 authored by Mathis Rosenhauer's avatar Mathis Rosenhauer
Browse files

More robust script to extract display from Xvnc log

parent 5546c84c
No related branches found
No related tags found
No related merge requests found
......@@ -78,19 +78,17 @@ cd \${HOME}
EOF
echo "Submitting Xvnc job."
job_id=$(ssh ${USERNAME}@mistral.dkrz.de "cd .startvnc && sbatch ${job_script}" | grep -Eoe "\b[0-9]+$")
job_id=$(ssh ${USERNAME}@mistral.dkrz.de "cd .startvnc && sbatch ${job_script}" | grep -Po "\b[0-9]+$")
ssh ${USERNAME}@mistral.dkrz.de "cat > .startvnc/vnc_gethost.${job_id}" <<EOF
#!/bin/bash
set -e
cd "\${0%/*}"
LOGFILE=out.${job_id}
while [ ! -f \${LOGFILE} ]; do
sleep 1
done
while [ -z \${vnc_host_display} ]; do
sleep 1
vnc_host_display=\$(grep "started on display" \${LOGFILE} | grep -Eoe "\bmg[0-9]+:[0-9]$")
if [[ -f \${LOGFILE} ]]; then
vnc_host_display=\$(grep -Po "started on display \Kmg[0-9]+:[0-9]+" \${LOGFILE})
fi
done
echo \${vnc_host_display}
EOF
......
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