mirror of
https://github.com/nextcloud/docker.git
synced 2025-02-06 03:18:26 +01:00
Fix POSIX shell differences of Alpine and Debian in occ
and occ-cron
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
This commit is contained in:
parent
4ff550e4d0
commit
67d1ed534e
2 changed files with 3 additions and 3 deletions
|
@ -12,8 +12,8 @@ fi
|
||||||
RUN_AS="$(stat -c %U /var/www/html/cron.php)"
|
RUN_AS="$(stat -c %U /var/www/html/cron.php)"
|
||||||
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ-cron\`: Failed to determine www-data user" >&2 ; exit 1 ; }
|
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ-cron\`: Failed to determine www-data user" >&2 ; exit 1 ; }
|
||||||
|
|
||||||
if [ "$(id -u)" == 0 ]; then
|
if [ "$(id -u)" = 0 ]; then
|
||||||
exec su -p "$RUN_AS" -s /bin/sh -c 'php -f /var/www/html/cron.php' -- '/bin/sh'
|
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/cron.php' -- '/bin/sh'
|
||||||
else
|
else
|
||||||
exec php -f /var/www/html/cron.php
|
exec php -f /var/www/html/cron.php
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,7 +7,7 @@ set -eu
|
||||||
RUN_AS="$(stat -c %U /var/www/html/occ)"
|
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 ; }
|
[ -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
|
if [ "$(id -u)" = 0 ]; then
|
||||||
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/occ -- "$@"' -- '/bin/sh' "$@"
|
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/occ -- "$@"' -- '/bin/sh' "$@"
|
||||||
else
|
else
|
||||||
exec php -f /var/www/html/occ -- "$@"
|
exec php -f /var/www/html/occ -- "$@"
|
||||||
|
|
Loading…
Reference in a new issue