From 7b0ffec85b5dbaeabf22217b6c650620bb76b7e1 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 --- 26/apache/occ | 2 +- 26/apache/occ-cron | 4 ++-- 26/fpm-alpine/occ | 2 +- 26/fpm-alpine/occ-cron | 4 ++-- 26/fpm/occ | 2 +- 26/fpm/occ-cron | 4 ++-- 27/apache/occ | 2 +- 27/apache/occ-cron | 4 ++-- 27/fpm-alpine/occ | 2 +- 27/fpm-alpine/occ-cron | 4 ++-- 27/fpm/occ | 2 +- 27/fpm/occ-cron | 4 ++-- 28/apache/occ | 2 +- 28/apache/occ-cron | 4 ++-- 28/fpm-alpine/occ | 2 +- 28/fpm-alpine/occ-cron | 4 ++-- 28/fpm/occ | 2 +- 28/fpm/occ-cron | 4 ++-- docker-occ-cron.sh | 4 ++-- docker-occ.sh | 2 +- 20 files changed, 30 insertions(+), 30 deletions(-) diff --git a/26/apache/occ b/26/apache/occ index 64c6d82c2d..70b08e7d36 100755 --- a/26/apache/occ +++ b/26/apache/occ @@ -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 -- "$@" diff --git a/26/apache/occ-cron b/26/apache/occ-cron index 9a4c58461c..798cc175a1 100755 --- a/26/apache/occ-cron +++ b/26/apache/occ-cron @@ -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/26/fpm-alpine/occ b/26/fpm-alpine/occ index 64c6d82c2d..70b08e7d36 100755 --- a/26/fpm-alpine/occ +++ b/26/fpm-alpine/occ @@ -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 -- "$@" diff --git a/26/fpm-alpine/occ-cron b/26/fpm-alpine/occ-cron index 9a4c58461c..798cc175a1 100755 --- a/26/fpm-alpine/occ-cron +++ b/26/fpm-alpine/occ-cron @@ -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/26/fpm/occ b/26/fpm/occ index 64c6d82c2d..70b08e7d36 100755 --- a/26/fpm/occ +++ b/26/fpm/occ @@ -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 -- "$@" diff --git a/26/fpm/occ-cron b/26/fpm/occ-cron index 9a4c58461c..798cc175a1 100755 --- a/26/fpm/occ-cron +++ b/26/fpm/occ-cron @@ -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/27/apache/occ b/27/apache/occ index 64c6d82c2d..70b08e7d36 100755 --- a/27/apache/occ +++ b/27/apache/occ @@ -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 -- "$@" diff --git a/27/apache/occ-cron b/27/apache/occ-cron index 9a4c58461c..798cc175a1 100755 --- a/27/apache/occ-cron +++ b/27/apache/occ-cron @@ -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/27/fpm-alpine/occ b/27/fpm-alpine/occ index 64c6d82c2d..70b08e7d36 100755 --- a/27/fpm-alpine/occ +++ b/27/fpm-alpine/occ @@ -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 -- "$@" diff --git a/27/fpm-alpine/occ-cron b/27/fpm-alpine/occ-cron index 9a4c58461c..798cc175a1 100755 --- a/27/fpm-alpine/occ-cron +++ b/27/fpm-alpine/occ-cron @@ -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/27/fpm/occ b/27/fpm/occ index 64c6d82c2d..70b08e7d36 100755 --- a/27/fpm/occ +++ b/27/fpm/occ @@ -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 -- "$@" diff --git a/27/fpm/occ-cron b/27/fpm/occ-cron index 9a4c58461c..798cc175a1 100755 --- a/27/fpm/occ-cron +++ b/27/fpm/occ-cron @@ -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/28/apache/occ b/28/apache/occ index 64c6d82c2d..70b08e7d36 100755 --- a/28/apache/occ +++ b/28/apache/occ @@ -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 -- "$@" diff --git a/28/apache/occ-cron b/28/apache/occ-cron index 9a4c58461c..798cc175a1 100755 --- a/28/apache/occ-cron +++ b/28/apache/occ-cron @@ -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/28/fpm-alpine/occ b/28/fpm-alpine/occ index 64c6d82c2d..70b08e7d36 100755 --- a/28/fpm-alpine/occ +++ b/28/fpm-alpine/occ @@ -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 -- "$@" diff --git a/28/fpm-alpine/occ-cron b/28/fpm-alpine/occ-cron index 9a4c58461c..798cc175a1 100755 --- a/28/fpm-alpine/occ-cron +++ b/28/fpm-alpine/occ-cron @@ -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/28/fpm/occ b/28/fpm/occ index 64c6d82c2d..70b08e7d36 100755 --- a/28/fpm/occ +++ b/28/fpm/occ @@ -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 -- "$@" diff --git a/28/fpm/occ-cron b/28/fpm/occ-cron index 9a4c58461c..798cc175a1 100755 --- a/28/fpm/occ-cron +++ b/28/fpm/occ-cron @@ -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-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 -- "$@"