2020-08-28 21:52:50 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
nextcloud_exec_no_shell() {
|
|
|
|
containerId="$1"; shift
|
|
|
|
|
|
|
|
# If a user must be specified when executing the task, set up that option here.
|
|
|
|
# You may also leave NEXTCLOUD_EXEC_USER blank, in which case it will not be used.
|
|
|
|
if [[ -n "$NEXTCLOUD_EXEC_USER" ]]; then
|
|
|
|
exec_user="--user $NEXTCLOUD_EXEC_USER"
|
|
|
|
fi
|
2023-11-09 09:18:19 +01:00
|
|
|
# shellcheck disable=SC2086
|
2023-11-09 09:15:52 +01:00
|
|
|
docker exec $exec_user "$containerId" "$@"
|
2020-08-28 21:52:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
nextcloud_exec() {
|
|
|
|
containerId="$1"; shift
|
2023-11-09 09:18:19 +01:00
|
|
|
# shellcheck disable=SC2086
|
2023-11-09 09:15:52 +01:00
|
|
|
nextcloud_exec_no_shell "$containerId" "$NEXTCLOUD_EXEC_SHELL" $NEXTCLOUD_EXEC_SHELL_ARGS "$@"
|
2020-08-28 21:52:50 +02:00
|
|
|
}
|