zuul-jobs/roles/intercept-job/files/waiter.sh
Clint Byrum 7eab57ab1e intercept-job -- self-service SSH access
This role is an attempt to allow self-service SSH access to nodes.

Change-Id: Icb6fb50b779c0bf2296e14436e4746355703f2ae
2021-04-23 15:14:06 +00:00

17 lines
303 B
Bash

#!/bin/bash
set -eu
INTERCEPT_STOP_FILE=${1:-}
if [ -z "${INTERCEPT_STOP_FILE}" ] ; then
echo usage: $0 intercept_stop_file
exit 1
fi
echo "to continue job:"
echo touch ${INTERCEPT_STOP_FILE}
echo
echo "to cancel job:"
echo kill $BASHPID
while ! [ -e "${INTERCEPT_STOP_FILE}" ] ; do
sleep 5
done