0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-06-15 15:54:47 +02:00

Run update.sh

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
This commit is contained in:
Daniel Rudolf 2023-12-22 18:38:57 +01:00
parent fe86b46167
commit da1c4fe6d3
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538
36 changed files with 423 additions and 153 deletions

14
27/fpm-alpine/occ Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
set -eu
[ -e /var/www/html/occ ] || { echo "Unable to run \`occ\`: No such file or directory" >&2 ; exit 1 ; }
[ -f /var/www/html/occ ] || { echo "Unable to run \`occ\`: Not a file" >&2 ; exit 1 ; }
RUN_AS="$(stat -c %U /var/www/html/occ)"
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ\`: Failed to determine www-data user" >&2 ; exit 1 ; }
if [ "$(id -u)" = 0 ]; then
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/occ -- "$@"' -- '/bin/sh' "$@"
else
exec php -f /var/www/html/occ -- "$@"
fi