0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-07-29 18:08:06 +02:00
nextcloud-docker/26/fpm/occ
Daniel Rudolf 8d9908de0b
Run update.sh
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2024-01-14 13:01:04 +01: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