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
|
|
|
|
|
2020-10-27 22:45:16 +01:00
|
|
|
docker exec $exec_user "$containerId" "$@"
|
2020-08-28 21:52:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
nextcloud_exec() {
|
|
|
|
containerId="$1"; shift
|
|
|
|
nextcloud_exec_no_shell "$containerId" "$NEXTCLOUD_EXEC_SHELL" $NEXTCLOUD_EXEC_SHELL_ARGS "$@"
|
|
|
|
}
|