From 584e56aceb0a11a7fbaec8830e1780a26062dac4 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 29 Jan 2020 16:01:08 +1100 Subject: [PATCH] Changes to mountpoint logic --- init | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/init b/init index 5f68d30..35cb6ea 100755 --- a/init +++ b/init @@ -11,7 +11,7 @@ function mp() { mountpoint -q $1 local mp=$? set -e - return ${mp} + echo ${mp} } # General Setup @@ -27,8 +27,7 @@ if [ "${role}" = "app" -a -e artisan ]; then exec /bin/bash fi - mp ${php} - mp=$? + mp=$(mp ${php}) # Only adjust perms if this is an external mountpoint if [ ${mp} -eq 0 -o -n "${FORCE_PERMS}" ] ; then @@ -53,8 +52,7 @@ if [ "${role}" = "app" -a -e artisan ]; then NODEV="--no-dev" fi - mp ${php} - mp=$? + mp=$(mp ${composer}) if [ ${mp} -eq 0 -o -n "${FORCE_PERMS}" ] ; then [ -n "${FORCE_PERMS}" -o "${env}" != "dev" -a -z "${SKIP_PERM}" ] && chown -R www-data:www-data ${composer} @@ -84,7 +82,8 @@ elif [ "$role" = "queue" -a -e artisan ]; then fi # We only check for non mount points, in case this container has the app inside - if ! mp ${php}; then + mp=$(mp ${php}) + if [ ${mp} -eq 1 ]; then echo "* Caching configuration..." su www-data -s /bin/sh -c "(php artisan config:cache && php artisan route:cache && php artisan view:cache)" fi @@ -106,7 +105,8 @@ elif [ "$role" = "scheduler" -a -e artisan ]; then fi # We only check for non mount points, in case this container has the app inside - if ! mp ${php}; then + mp=$(mp ${php}) + if [ ${mp} -eq 1 ]; then echo "* Caching configuration..." su www-data -s /bin/sh -c "(php artisan config:cache && php artisan route:cache && php artisan view:cache)" fi