From a775ce3ac1207d0d6ab73534d13230d91dce38cb Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 6 Nov 2019 22:28:42 +0100 Subject: [PATCH] Fix certbot-auto --- letsencrypt-auto-source/letsencrypt-auto | 6 ++++++ letsencrypt-auto-source/letsencrypt-auto.template | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/letsencrypt-auto-source/letsencrypt-auto b/letsencrypt-auto-source/letsencrypt-auto index 68d3aca1d..5489fd566 100755 --- a/letsencrypt-auto-source/letsencrypt-auto +++ b/letsencrypt-auto-source/letsencrypt-auto @@ -1888,6 +1888,12 @@ UNLIKELY_EOF error "WARNING: unable to check for updates." fi + # If for any reason REMOTE_VERSION is not set, let's assume certbot-auto is up-to-date, + # in order to avoid potential failures because of an unset REMOTE_VERSION variable. + if [ -z "$REMOTE_VERSION" ]; then + REMOTE_VERSION="$LE_AUTO_VERSION" + fi + LE_VERSION_STATE=`CompareVersions "$LE_PYTHON" "$LE_AUTO_VERSION" "$REMOTE_VERSION"` if [ "$LE_VERSION_STATE" = "UNOFFICIAL" ]; then say "Unofficial certbot-auto version detected, self-upgrade is disabled: $LE_AUTO_VERSION" diff --git a/letsencrypt-auto-source/letsencrypt-auto.template b/letsencrypt-auto-source/letsencrypt-auto.template index bc4b92092..a9ed3abf2 100755 --- a/letsencrypt-auto-source/letsencrypt-auto.template +++ b/letsencrypt-auto-source/letsencrypt-auto.template @@ -764,6 +764,12 @@ UNLIKELY_EOF error "WARNING: unable to check for updates." fi + # If for any reason REMOTE_VERSION is not set, let's assume certbot-auto is up-to-date, + # in order to avoid potential failures because of an unset REMOTE_VERSION variable. + if [ -z "$REMOTE_VERSION" ]; then + REMOTE_VERSION="$LE_AUTO_VERSION" + fi + LE_VERSION_STATE=`CompareVersions "$LE_PYTHON" "$LE_AUTO_VERSION" "$REMOTE_VERSION"` if [ "$LE_VERSION_STATE" = "UNOFFICIAL" ]; then say "Unofficial certbot-auto version detected, self-upgrade is disabled: $LE_AUTO_VERSION"