2018-12-02 02:08:31 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
2019-06-21 02:15:55 +02:00
|
|
|
if [[ ! -z "$NEXTCLOUD_PROJECT_NAME" ]]; then
|
|
|
|
containerName="${NEXTCLOUD_PROJECT_NAME}_"
|
|
|
|
else
|
|
|
|
matchEnd=","
|
|
|
|
fi
|
2018-12-02 02:08:31 +01:00
|
|
|
|
2019-06-21 02:15:55 +02:00
|
|
|
containerName="${containerName}${NEXTCLOUD_CONTAINER_NAME}"
|
|
|
|
|
|
|
|
# Get the ID of the container so we can exec something in it later
|
2018-12-02 02:08:31 +01:00
|
|
|
docker ps --format '{{.Names}},{{.ID}}' | \
|
|
|
|
egrep "^${containerName}${matchEnd}" | \
|
|
|
|
awk '{split($0,a,","); print a[2]}'
|