From f07b8d15379e41b546fa1ba9370c80c0a0fa1f81 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 3 Jan 2020 10:48:13 +0100 Subject: [PATCH] Corrections --- letsencrypt-auto-source/letsencrypt-auto | 2 +- .../tests/centos6_tests.sh | 24 +++++++------------ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/letsencrypt-auto-source/letsencrypt-auto b/letsencrypt-auto-source/letsencrypt-auto index 8e7fff0a3..2e658f642 100755 --- a/letsencrypt-auto-source/letsencrypt-auto +++ b/letsencrypt-auto-source/letsencrypt-auto @@ -1085,7 +1085,7 @@ if [ "$1" = "--le-auto-phase2" ]; then # In this situation, we bypass any bootstrap or certbot venv setup. error "Your system is not supported by certbot-auto anymore." - if OldVenvExists; then + if [ ! -d "$VENV_PATH" ] && OldVenvExists; then VENV_BIN="$OLD_VENV_PATH/bin" fi diff --git a/letsencrypt-auto-source/tests/centos6_tests.sh b/letsencrypt-auto-source/tests/centos6_tests.sh index 48e721226..713e83b16 100644 --- a/letsencrypt-auto-source/tests/centos6_tests.sh +++ b/letsencrypt-auto-source/tests/centos6_tests.sh @@ -32,8 +32,6 @@ if python3 --version 2> /dev/null; then fi # ensure python2.7 is available -python2.7 --version 2> /dev/null -RESULT=$? if ! python2.7 --version 2> /dev/null; then echo "Python2.7 is not available." exit 1 @@ -88,14 +86,12 @@ unset VENV_PATH # ensure CentOS6 32bits is not supported anymore, and so certbot # is not upgraded nor reinstalled. export UNAME_FAKE_32BITS=true -if ! "$LE_AUTO" --version > /dev/null 2> /dev/null; then - echo "On CentOS 6 32 bits, certbot-auto failed to run installed certbot instance." - exit 1 -fi +set -o pipefail if ! "$LE_AUTO" --version 2>&1 | grep -q "Certbot will no longer receive updates."; then - echo "On CentOS 6 32 bits, certbot-auto upgraded installed certbot instance." + echo "On CentOS 6 32 bits, certbot-auto failed or upgraded installed certbot instance." exit 1 fi +set +o pipefail if ! "$LE_AUTO" --install-only 2>&1 | grep -q "Certbot cannot be installed."; then echo "On CentOS 6 32 bits, certbot-auto installed certbot again." exit 1 @@ -105,18 +101,16 @@ fi # we're going to modify env variables, so do this in a subshell ( # Prepare a certbot installation in the old venv path -export VENV_PATH=~/.local/share/letsencrypt -"$LE_AUTO" --install-only > /dev/null 2> /dev/null +rm -rf /opt/eff.org +VENV_PATH=~/.local/share/letsencrypt "$LE_AUTO" --install-only > /dev/null 2> /dev/null # fake 32 bits mode export UNAME_FAKE_32BITS=true -if ! "$LE_AUTO" --version > /dev/null 2> /dev/null; then - echo "On CentOS 6 32 bits, certbot-auto failed to run installed certbot instance in the old venv path." - exit 1 -fi -if ! "$LE_AUTO" 2>&1 | grep -q "Certbot will no longer receive updates."; then - echo "On CentOS 6 32 bits, certbot-auto upgraded installed certbot in the old venv path." +set -o pipefail +if ! "$LE_AUTO" --version 2>&1 | grep -q "Certbot will no longer receive updates."; then + echo "On CentOS 6 32 bits, certbot-auto failed or upgraded installed certbot in the old venv path." exit 1 fi +set +o pipefail ) echo "PASSED: On CentOS 6 32 bits, certbot-auto refused to install/upgrade certbot."