From 27317e24c46f43de4002ddd95ca4970c68721fa8 Mon Sep 17 00:00:00 2001 From: Toon Van Dooren Date: Sat, 23 Sep 2023 23:12:24 +0200 Subject: [PATCH] #155: fix var names --- commands/env.cmd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/commands/env.cmd b/commands/env.cmd index 4f792297..889c8eda 100644 --- a/commands/env.cmd +++ b/commands/env.cmd @@ -4,8 +4,8 @@ WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? assertDockerRunning -HOSTUID=$(id -u) -HOSTGID=$(id -g) +HOST_UID=$(id -u) +HOST_GID=$(id -g) if (( ${#WARDEN_PARAMS[@]} == 0 )) || [[ "${WARDEN_PARAMS[0]}" == "help" ]]; then # shellcheck disable=SC2153 @@ -231,14 +231,14 @@ then fi if [[ "${WARDEN_PARAMS[0]}" == "up" ]] || [[ "${WARDEN_PARAMS[0]}" == "start" ]]; then - if [[ $($WARDEN_BIN env ps -q php-fpm) ]] && [ $($WARDEN_BIN env exec php-fpm "id" "-u" "www-data") != ${HOSTUID} ]; then - $WARDEN_BIN env exec -u 0 php-fpm "usermod" "-u" "${HOSTUID}" "www-data" - $WARDEN_BIN env exec -u 0 php-fpm "usermod" "-g" "${HOSTGID}" "www-data" + if [[ $($WARDEN_BIN env ps -q php-fpm) ]] && [ $($WARDEN_BIN env exec php-fpm "id" "-u" "www-data") != ${HOST_UID} ]; then + $WARDEN_BIN env exec -u 0 php-fpm "usermod" "-u" "${HOST_UID}" "www-data" + $WARDEN_BIN env exec -u 0 php-fpm "usermod" "-g" "${HOST_GID}" "www-data" $WARDEN_BIN env restart php-fpm fi - if [[ $($WARDEN_BIN env ps -q php-debug) ]] && [ $($WARDEN_BIN env exec php-debug "id" "-u" "www-data") != ${HOSTUID} ]; then - $WARDEN_BIN env exec -u 0 php-debug "usermod" "-u" "${HOSTUID}" "www-data" - $WARDEN_BIN env exec -u 0 php-debug "usermod" "-g" "${HOSTGID}" "www-data" + if [[ $($WARDEN_BIN env ps -q php-debug) ]] && [ $($WARDEN_BIN env exec php-debug "id" "-u" "www-data") != ${HOST_UID} ]; then + $WARDEN_BIN env exec -u 0 php-debug "usermod" "-u" "${HOST_UID}" "www-data" + $WARDEN_BIN env exec -u 0 php-debug "usermod" "-g" "${HOST_GID}" "www-data" $WARDEN_BIN env restart php-debug fi fi