From a18d638bf252bc5b4d07207b2f1bfcaff84c995c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Perrin?= Date: Fri, 28 Feb 2020 14:21:40 -0600 Subject: [PATCH] Make already existing files owned by current user --- docker-entrypoint.sh | 6 +++--- php7.2/apache/docker-entrypoint.sh | 6 +++--- php7.2/fpm-alpine/docker-entrypoint.sh | 6 +++--- php7.2/fpm/docker-entrypoint.sh | 6 +++--- php7.3/apache/docker-entrypoint.sh | 6 +++--- php7.3/fpm-alpine/docker-entrypoint.sh | 6 +++--- php7.3/fpm/docker-entrypoint.sh | 6 +++--- php7.4/apache/docker-entrypoint.sh | 6 +++--- php7.4/fpm-alpine/docker-entrypoint.sh | 6 +++--- php7.4/fpm/docker-entrypoint.sh | 6 +++--- 10 files changed, 30 insertions(+), 30 deletions(-) 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..."