From b639405e9b2b2d7b6796f1ce02d8d6c6905c1fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Mon, 7 Aug 2023 22:26:14 +0200 Subject: [PATCH] fix: only return one container when searching (#22) --- scripts/find-container.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/find-container.sh b/scripts/find-container.sh index 8ae0272..e2e6c99 100755 --- a/scripts/find-container.sh +++ b/scripts/find-container.sh @@ -10,7 +10,8 @@ fi containerName="${containerName}${NEXTCLOUD_CONTAINER_NAME}" -# Get the ID of the container so we can exec something in it later +# Get the ID of the first matching container so we can exec something in it later docker ps --format '{{.Names}},{{.ID}}' | \ egrep "^${containerName}${matchEnd}" | \ - awk '{split($0,a,","); print a[2]}' + awk '{split($0,a,","); print a[2]}' | \ + head -n 1