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