From 29161176effc8668857d8423f2483e25becb24dc Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 4 Dec 2019 21:06:53 +0100 Subject: [PATCH] Update template --- letsencrypt-auto-source/letsencrypt-auto | 36 +++++++++++-------- .../letsencrypt-auto.template | 34 ++++++++++-------- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/letsencrypt-auto-source/letsencrypt-auto b/letsencrypt-auto-source/letsencrypt-auto index 3689cc7a4..ad40e3b26 100755 --- a/letsencrypt-auto-source/letsencrypt-auto +++ b/letsencrypt-auto-source/letsencrypt-auto @@ -758,7 +758,7 @@ elif [ -f /etc/redhat-release ]; then RPM_DIST_NAME=`(. /etc/os-release 2> /dev/null && echo $ID) || echo "unknown"` - if [ "$PYVER" -eq 26 -a "$RPM_DIST_NAME" != "rhel" -a $(arch) != 'x86_64' ]; then + if [ "$PYVER" -eq 26 -a "$RPM_DIST_NAME" != "rhel" -a $(uname -m) != 'x86_64' ]; then # 32 bits CentOS 6 and affiliates (except RHEL) are not supported anymore by certbot-auto. DEPRECATED_OS=1 fi @@ -877,7 +877,7 @@ fi if [ "$DEPRECATED_OS" = 1 ]; then Bootstrap() { - error "Skipping bootstrap on deprecated systems." + error "Skipping bootstrap because certbot-auto is deprecated on this system." } unset BOOTSTRAP_VERSION fi @@ -1075,22 +1075,28 @@ if __name__ == '__main__': UNLIKELY_EOF } -if [ "$1" = "--le-auto-phase2" -a "$DEPRECATED_OS" = 1 ]; then - # Phase 2 damage control mode for deprecated OSes. - # In this situation, we bypass any bootstrap or certbot venv setup. - shift 1 - - error "Your system is not supported by certbot-auto anymore, and so certbot cannot be installed or upgraded." - error "Please consult official Certbot site (https://certbot.eff.org/) to check other alternatives." - - if [ -f "$VENV_BIN/letsencrypt" ]; then - "$VENV_BIN/letsencrypt" "$@" - fi - -elif [ "$1" = "--le-auto-phase2" ]; then +if [ "$1" = "--le-auto-phase2" ]; then # Phase 2: Create venv, install LE, and run. shift 1 # the --le-auto-phase2 arg + + if [ "$DEPRECATED_OS" = 1 ]; then + # Phase 2 damage control mode for deprecated OSes. + # In this situation, we bypass any bootstrap or certbot venv setup. + error "Your system is not supported by certbot-auto anymore." + + if [ -f "$VENV_BIN/letsencrypt" ]; then + error "Certbot will no longer receive updates." + error "Please visit https://certbot.eff.org/ to check for other alternatives." + "$VENV_BIN/letsencrypt" "$@" + exit 0 + else + error "Certbot cannot be installed." + error "Please visit https://certbot.eff.org/ to check for other alternatives." + exit 1 + fi + fi + SetPrevBootstrapVersion if [ -z "$PHASE_1_VERSION" -a "$USE_PYTHON_3" = 1 ]; then diff --git a/letsencrypt-auto-source/letsencrypt-auto.template b/letsencrypt-auto-source/letsencrypt-auto.template index 8a1cadcf5..78b4f0109 100755 --- a/letsencrypt-auto-source/letsencrypt-auto.template +++ b/letsencrypt-auto-source/letsencrypt-auto.template @@ -333,7 +333,7 @@ elif [ -f /etc/redhat-release ]; then RPM_DIST_NAME=`(. /etc/os-release 2> /dev/null && echo $ID) || echo "unknown"` - if [ "$PYVER" -eq 26 -a "$RPM_DIST_NAME" != "rhel" -a $(arch) != 'x86_64' ]; then + if [ "$PYVER" -eq 26 -a "$RPM_DIST_NAME" != "rhel" -a $(uname -m) != 'x86_64' ]; then # 32 bits CentOS 6 and affiliates (except RHEL) are not supported anymore by certbot-auto. DEPRECATED_OS=1 fi @@ -542,22 +542,28 @@ CheckPathPermissions() { UNLIKELY_EOF } -if [ "$1" = "--le-auto-phase2" -a "$DEPRECATED_OS" = 1 ]; then - # Phase 2 damage control mode for deprecated OSes. - # In this situation, we bypass any bootstrap or certbot venv setup. - shift 1 - - error "Your system is not supported by certbot-auto anymore, and so certbot cannot be installed or upgraded." - error "Please consult official Certbot site (https://certbot.eff.org/) to check other alternatives." - - if [ -f "$VENV_BIN/letsencrypt" ]; then - "$VENV_BIN/letsencrypt" "$@" - fi - -elif [ "$1" = "--le-auto-phase2" ]; then +if [ "$1" = "--le-auto-phase2" ]; then # Phase 2: Create venv, install LE, and run. shift 1 # the --le-auto-phase2 arg + + if [ "$DEPRECATED_OS" = 1 ]; then + # Phase 2 damage control mode for deprecated OSes. + # In this situation, we bypass any bootstrap or certbot venv setup. + error "Your system is not supported by certbot-auto anymore." + + if [ -f "$VENV_BIN/letsencrypt" ]; then + error "Certbot will no longer receive updates." + error "Please visit https://certbot.eff.org/ to check for other alternatives." + "$VENV_BIN/letsencrypt" "$@" + exit 0 + else + error "Certbot cannot be installed." + error "Please visit https://certbot.eff.org/ to check for other alternatives." + exit 1 + fi + fi + SetPrevBootstrapVersion if [ -z "$PHASE_1_VERSION" -a "$USE_PYTHON_3" = 1 ]; then