From dd833d40c649dc8f0e4dfa550f5fa21b9dd53cbe Mon Sep 17 00:00:00 2001 From: copyrights <219009+copyrights@users.noreply.github.com> Date: Sat, 18 Apr 2020 22:27:56 +0200 Subject: [PATCH] fix chmod would fail if needed. (#3482) Co-authored-by: copyrights --- update.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/update.sh b/update.sh index d3ce2913..d1fb19f2 100755 --- a/update.sh +++ b/update.sh @@ -459,11 +459,12 @@ elif [[ $(curl -sL -w "%{http_code}" https://www.servercow.de/docker-compose/lat LATEST_COMPOSE=$(curl -#L https://www.servercow.de/docker-compose/latest.php) COMPOSE_VERSION=$(docker-compose version --short) if [[ "$LATEST_COMPOSE" != "$COMPOSE_VERSION" ]]; then - if [[ -w $(which docker-compose) ]]; then - curl -#L https://github.com/docker/compose/releases/download/${LATEST_COMPOSE}/docker-compose-$(uname -s)-$(uname -m) > $(which docker-compose) - chmod +x $(which docker-compose) + COMPOSE_PATH=$(which docker-compose) + if [[ -w ${COMPOSE_PATH} ]]; then + curl -#L https://github.com/docker/compose/releases/download/${LATEST_COMPOSE}/docker-compose-$(uname -s)-$(uname -m) > $COMPOSE_PATH + chmod +x $COMPOSE_PATH else - echo -e "\e[33mWARNING: $(which docker-compose) is not writable, but new version $LATEST_COMPOSE is available (installed: $COMPOSE_VERSION)\e[0m" + echo -e "\e[33mWARNING: $COMPOSE_PATH is not writable, but new version $LATEST_COMPOSE is available (installed: $COMPOSE_VERSION)\e[0m" fi fi else