Fetch origin before update check
This commit is contained in:
parent
426b597d02
commit
00395b99c6
@ -24,7 +24,7 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|||||||
case "${1}" in
|
case "${1}" in
|
||||||
--check|-c)
|
--check|-c)
|
||||||
echo "Checking remote code for updates..."
|
echo "Checking remote code for updates..."
|
||||||
git fetch
|
git fetch origin ${BRANCH}
|
||||||
if ! git diff origin/${BRANCH} --quiet; then
|
if ! git diff origin/${BRANCH} --quiet; then
|
||||||
echo "Updated code is available."
|
echo "Updated code is available."
|
||||||
else
|
else
|
||||||
@ -34,8 +34,6 @@ case "${1}" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
TMPFILE=$(mktemp "${TMPDIR:-/tmp}/curldata.XXXXXX")
|
|
||||||
|
|
||||||
echo -e "\e[32mChecking for newer update script...\e[0m"
|
echo -e "\e[32mChecking for newer update script...\e[0m"
|
||||||
SHA1_1=$(sha1sum update.sh)
|
SHA1_1=$(sha1sum update.sh)
|
||||||
git fetch origin ${BRANCH}
|
git fetch origin ${BRANCH}
|
||||||
@ -46,7 +44,6 @@ if [[ ${SHA1_1} != ${SHA1_2} ]]; then
|
|||||||
chmod +x update.sh
|
chmod +x update.sh
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
rm -f mv ${TMPFILE}
|
|
||||||
|
|
||||||
if [[ -f mailcow.conf ]]; then
|
if [[ -f mailcow.conf ]]; then
|
||||||
source mailcow.conf
|
source mailcow.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user