From 5568e75f6a69b0a04e1ae7d75a2b5bbabe946370 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Sun, 13 Oct 2024 04:47:04 +0200 Subject: [PATCH] build(docker): make watchcontainerrun.sh more silent and working --- utils/watchcontainerrun.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 utils/watchcontainerrun.sh diff --git a/utils/watchcontainerrun.sh b/utils/watchcontainerrun.sh old mode 100644 new mode 100755 index fc2bfca06..2a9c71156 --- a/utils/watchcontainerrun.sh +++ b/utils/watchcontainerrun.sh @@ -7,7 +7,7 @@ FILENAME="$2" STARTSCRIPT="$3" CLEANUPSCRIPT="$4" -while ! grep 'CONTAINER_ID=' "$FILENAME" ; do +while ! grep -q 'CONTAINER_ID=' "$FILENAME" ; do sleep 1 done @@ -19,7 +19,9 @@ $STARTSCRIPT while [ -e "$FILENAME" ] ; do sleep 1 - if ! $RUNNER ps | grep "$CONTAINER_ID" ; then + if ! $RUNNER ps --no-trunc | grep -q "$CONTAINER_ID" ; then + $RUNNER ps | grep "$CONTAINER_ID" + rm "$FILENAME" exit fi inotifywait -e ATTRIB -t 10 "$FILENAME" > /dev/null 2&>/dev/null @@ -29,7 +31,5 @@ $RUNNER stop "$CONTAINER_ID" $CLEANUPSCRIPT -rm "$FILENAME" - #$UTILPATH/watchrun.sh "$FILENAME" "$STARTSCRIPT" "$CLEANUPSCRIPT"