diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 4805588cc3..f4b7096432 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..." diff --git a/php7.2/apache/docker-entrypoint.sh b/php7.2/apache/docker-entrypoint.sh index 4805588cc3..ad9cdea0b3 100755 --- a/php7.2/apache/docker-entrypoint.sh +++ b/php7.2/apache/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..." diff --git a/php7.2/fpm-alpine/docker-entrypoint.sh b/php7.2/fpm-alpine/docker-entrypoint.sh index 4805588cc3..ad9cdea0b3 100755 --- a/php7.2/fpm-alpine/docker-entrypoint.sh +++ b/php7.2/fpm-alpine/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..." diff --git a/php7.2/fpm/docker-entrypoint.sh b/php7.2/fpm/docker-entrypoint.sh index 4805588cc3..ad9cdea0b3 100755 --- a/php7.2/fpm/docker-entrypoint.sh +++ b/php7.2/fpm/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..." diff --git a/php7.3/apache/docker-entrypoint.sh b/php7.3/apache/docker-entrypoint.sh index 4805588cc3..ad9cdea0b3 100755 --- a/php7.3/apache/docker-entrypoint.sh +++ b/php7.3/apache/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..." diff --git a/php7.3/fpm-alpine/docker-entrypoint.sh b/php7.3/fpm-alpine/docker-entrypoint.sh index 4805588cc3..ad9cdea0b3 100755 --- a/php7.3/fpm-alpine/docker-entrypoint.sh +++ b/php7.3/fpm-alpine/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..." diff --git a/php7.3/fpm/docker-entrypoint.sh b/php7.3/fpm/docker-entrypoint.sh index 4805588cc3..ad9cdea0b3 100755 --- a/php7.3/fpm/docker-entrypoint.sh +++ b/php7.3/fpm/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..." diff --git a/php7.4/apache/docker-entrypoint.sh b/php7.4/apache/docker-entrypoint.sh index 4805588cc3..ad9cdea0b3 100755 --- a/php7.4/apache/docker-entrypoint.sh +++ b/php7.4/apache/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..." diff --git a/php7.4/fpm-alpine/docker-entrypoint.sh b/php7.4/fpm-alpine/docker-entrypoint.sh index 4805588cc3..ad9cdea0b3 100755 --- a/php7.4/fpm-alpine/docker-entrypoint.sh +++ b/php7.4/fpm-alpine/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..." diff --git a/php7.4/fpm/docker-entrypoint.sh b/php7.4/fpm/docker-entrypoint.sh index 4805588cc3..ad9cdea0b3 100755 --- a/php7.4/fpm/docker-entrypoint.sh +++ b/php7.4/fpm/docker-entrypoint.sh @@ -46,9 +46,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then fi if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then - # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . + # if the directory exists and WordPress doesn't appear to be installed, let's chown it (likely a Docker-created directory) of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$(id -u)" = '0' ]; then + chown -R "$user:$group" . fi echo >&2 "WordPress not found in $PWD - copying now..."