Skip to content

Commit 7b0ffec

Browse files
committed
Fix POSIX shell differences of Alpine and Debian in occ and occ-cron
Signed-off-by: Daniel Rudolf <[email protected]>
1 parent a084db4 commit 7b0ffec

File tree

20 files changed

+30
-30
lines changed

20 files changed

+30
-30
lines changed

26/apache/occ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -eu
77
RUN_AS="$(stat -c %U /var/www/html/occ)"
88
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ\`: Failed to determine www-data user" >&2 ; exit 1 ; }
99

10-
if [ "$(id -u)" == 0 ]; then
10+
if [ "$(id -u)" = 0 ]; then
1111
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/occ -- "$@"' -- '/bin/sh' "$@"
1212
else
1313
exec php -f /var/www/html/occ -- "$@"

26/apache/occ-cron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fi
1212
RUN_AS="$(stat -c %U /var/www/html/cron.php)"
1313
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ-cron\`: Failed to determine www-data user" >&2 ; exit 1 ; }
1414

15-
if [ "$(id -u)" == 0 ]; then
16-
exec su -p "$RUN_AS" -s /bin/sh -c 'php -f /var/www/html/cron.php' -- '/bin/sh'
15+
if [ "$(id -u)" = 0 ]; then
16+
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/cron.php' -- '/bin/sh'
1717
else
1818
exec php -f /var/www/html/cron.php
1919
fi

26/fpm-alpine/occ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -eu
77
RUN_AS="$(stat -c %U /var/www/html/occ)"
88
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ\`: Failed to determine www-data user" >&2 ; exit 1 ; }
99

10-
if [ "$(id -u)" == 0 ]; then
10+
if [ "$(id -u)" = 0 ]; then
1111
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/occ -- "$@"' -- '/bin/sh' "$@"
1212
else
1313
exec php -f /var/www/html/occ -- "$@"

26/fpm-alpine/occ-cron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fi
1212
RUN_AS="$(stat -c %U /var/www/html/cron.php)"
1313
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ-cron\`: Failed to determine www-data user" >&2 ; exit 1 ; }
1414

15-
if [ "$(id -u)" == 0 ]; then
16-
exec su -p "$RUN_AS" -s /bin/sh -c 'php -f /var/www/html/cron.php' -- '/bin/sh'
15+
if [ "$(id -u)" = 0 ]; then
16+
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/cron.php' -- '/bin/sh'
1717
else
1818
exec php -f /var/www/html/cron.php
1919
fi

26/fpm/occ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -eu
77
RUN_AS="$(stat -c %U /var/www/html/occ)"
88
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ\`: Failed to determine www-data user" >&2 ; exit 1 ; }
99

10-
if [ "$(id -u)" == 0 ]; then
10+
if [ "$(id -u)" = 0 ]; then
1111
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/occ -- "$@"' -- '/bin/sh' "$@"
1212
else
1313
exec php -f /var/www/html/occ -- "$@"

26/fpm/occ-cron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fi
1212
RUN_AS="$(stat -c %U /var/www/html/cron.php)"
1313
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ-cron\`: Failed to determine www-data user" >&2 ; exit 1 ; }
1414

15-
if [ "$(id -u)" == 0 ]; then
16-
exec su -p "$RUN_AS" -s /bin/sh -c 'php -f /var/www/html/cron.php' -- '/bin/sh'
15+
if [ "$(id -u)" = 0 ]; then
16+
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/cron.php' -- '/bin/sh'
1717
else
1818
exec php -f /var/www/html/cron.php
1919
fi

27/apache/occ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -eu
77
RUN_AS="$(stat -c %U /var/www/html/occ)"
88
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ\`: Failed to determine www-data user" >&2 ; exit 1 ; }
99

10-
if [ "$(id -u)" == 0 ]; then
10+
if [ "$(id -u)" = 0 ]; then
1111
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/occ -- "$@"' -- '/bin/sh' "$@"
1212
else
1313
exec php -f /var/www/html/occ -- "$@"

27/apache/occ-cron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fi
1212
RUN_AS="$(stat -c %U /var/www/html/cron.php)"
1313
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ-cron\`: Failed to determine www-data user" >&2 ; exit 1 ; }
1414

15-
if [ "$(id -u)" == 0 ]; then
16-
exec su -p "$RUN_AS" -s /bin/sh -c 'php -f /var/www/html/cron.php' -- '/bin/sh'
15+
if [ "$(id -u)" = 0 ]; then
16+
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/cron.php' -- '/bin/sh'
1717
else
1818
exec php -f /var/www/html/cron.php
1919
fi

27/fpm-alpine/occ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -eu
77
RUN_AS="$(stat -c %U /var/www/html/occ)"
88
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ\`: Failed to determine www-data user" >&2 ; exit 1 ; }
99

10-
if [ "$(id -u)" == 0 ]; then
10+
if [ "$(id -u)" = 0 ]; then
1111
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/occ -- "$@"' -- '/bin/sh' "$@"
1212
else
1313
exec php -f /var/www/html/occ -- "$@"

27/fpm-alpine/occ-cron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fi
1212
RUN_AS="$(stat -c %U /var/www/html/cron.php)"
1313
[ -n "$RUN_AS" ] && [ "$RUN_AS" != "UNKNOWN" ] || { echo "Unable to run \`occ-cron\`: Failed to determine www-data user" >&2 ; exit 1 ; }
1414

15-
if [ "$(id -u)" == 0 ]; then
16-
exec su -p "$RUN_AS" -s /bin/sh -c 'php -f /var/www/html/cron.php' -- '/bin/sh'
15+
if [ "$(id -u)" = 0 ]; then
16+
exec su -p "$RUN_AS" -s /bin/sh -c 'exec php -f /var/www/html/cron.php' -- '/bin/sh'
1717
else
1818
exec php -f /var/www/html/cron.php
1919
fi

0 commit comments

Comments
 (0)