From e68dd9b48b9e7dc9eddb9e5f5d8dd18329d031fd Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Fri, 15 Dec 2023 14:43:28 +0100 Subject: [PATCH] Fix POSIX shell differences of Alpine and Debian in `occ` and `occ-cron` Signed-off-by: Daniel Rudolf --- docker-occ-cron.sh | 4 ++-- docker-occ.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-occ-cron.sh b/docker-occ-cron.sh index 9a4c58461c..798cc175a1 100755 --- a/docker-occ-cron.sh +++ b/docker-occ-cron.sh @@ -12,8 +12,8 @@ fi 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 ; } -if [ "$(id -u)" == 0 ]; then - exec su -p "$RUN_AS" -s /bin/sh -c 'php -f /var/www/html/cron.php' -- '/bin/sh' +if [ "$(id -u)" = 0 ]; then + exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/cron.php' -- '/bin/sh' else exec php -f /var/www/html/cron.php fi diff --git a/docker-occ.sh b/docker-occ.sh index 64c6d82c2d..70b08e7d36 100755 --- a/docker-occ.sh +++ b/docker-occ.sh @@ -7,7 +7,7 @@ set -eu 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 +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 -- "$@"