0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-03-14 18:35:08 +01:00
nextcloud-docker/28/fpm/occ
Daniel Rudolf da1c4fe6d3
Run update.sh
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2024-07-23 16:25:27 +02:00

14 lines
561 B
Bash
Executable file

#!/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