build(utils/watchcontainerrun.sh): Waiting at most 20 seconds for containerfile now.

This commit is contained in:
Stephan Barth 2024-10-20 02:06:16 +02:00
parent 1212d20401
commit 1ef9a340cd

View File

@ -7,8 +7,15 @@ FILENAME="$2"
STARTSCRIPT="$3"
CLEANUPSCRIPT="$4"
while ! grep -q 'CONTAINER_ID=' "$FILENAME" ; do
TRIES=1
while ! grep -q 'CONTAINER_ID=' "$FILENAME" > /dev/null 2&>/dev/null ; do
sleep 1
TRIES=$((1+$TRIES))
if [ "$TRIES" -ge 20 ] ; then
echo "$0: Containerfile $FILENAME did not show up after 20 seconds, giving up now!" >&2
exit
fi
done
sleep 1 # safety, we do not want to have half written container ids