From 00395b99c68ae89ed8d5a83c2e9270641a6f2db0 Mon Sep 17 00:00:00 2001 From: andryyy Date: Thu, 29 Jun 2017 21:45:09 +0200 Subject: [PATCH] Fetch origin before update check --- update.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/update.sh b/update.sh index 9a50941e..d5645144 100755 --- a/update.sh +++ b/update.sh @@ -24,7 +24,7 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD) case "${1}" in --check|-c) echo "Checking remote code for updates..." - git fetch + git fetch origin ${BRANCH} if ! git diff origin/${BRANCH} --quiet; then echo "Updated code is available." else @@ -34,8 +34,6 @@ case "${1}" in ;; esac -TMPFILE=$(mktemp "${TMPDIR:-/tmp}/curldata.XXXXXX") - echo -e "\e[32mChecking for newer update script...\e[0m" SHA1_1=$(sha1sum update.sh) git fetch origin ${BRANCH} @@ -46,7 +44,6 @@ if [[ ${SHA1_1} != ${SHA1_2} ]]; then chmod +x update.sh exit 0 fi -rm -f mv ${TMPFILE} if [[ -f mailcow.conf ]]; then source mailcow.conf