From bbade209aa847baf120cb7ad5036e10a76edd4a8 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jul 2019 10:16:22 +0200 Subject: [PATCH] Various corrections --- letsencrypt-auto-source/letsencrypt-auto | 34 +++++++++---------- .../letsencrypt-auto.template | 6 ++-- .../pieces/bootstrappers/rpm_common_base.sh | 8 ++--- .../bootstrappers/rpm_python3_legacy.sh | 20 +++++------ 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/letsencrypt-auto-source/letsencrypt-auto b/letsencrypt-auto-source/letsencrypt-auto index 5eea70575..7d386fff6 100755 --- a/letsencrypt-auto-source/letsencrypt-auto +++ b/letsencrypt-auto-source/letsencrypt-auto @@ -390,17 +390,17 @@ InitializeRPMCommonBase() { fi if ! $TOOL list *virtualenv >/dev/null 2>&1; then - echo "To use Certbot, packages from the EPEL repository need to be installed." + echo "To use Certbot on this operating system, packages from the EPEL repository need to be installed." if ! $TOOL list epel-release >/dev/null 2>&1; then error "Enable the EPEL repository and try running Certbot again." exit 1 fi if [ "$ASSUME_YES" = 1 ]; then - /bin/echo -n "Enabling the EPEL repository in 3 seconds..." + /bin/echo -n "Enabling the EPEL repository in 3 seconds... (Press Ctrl-C to cancel)" sleep 1s - /bin/echo -ne "\e[0K\rEnabling the EPEL repository in 2 seconds..." + /bin/echo -ne "\e[0K\rEnabling the EPEL repository in 2 seconds... (Press Ctrl-C to cancel)" sleep 1s - /bin/echo -e "\e[0K\rEnabling the EPEL repository in 1 second..." + /bin/echo -e "\e[0K\rEnabling the EPEL repository in 1 second... (Press Ctrl-C to cancel)" sleep 1s fi if ! $TOOL install $YES_FLAG $QUIET_FLAG epel-release; then @@ -498,28 +498,28 @@ BootstrapRpmPython3Legacy() { InitializeRPMCommonBase - if ! $TOOL list rh-python36 >/dev/null 2>&1; then - echo "To use Certbot, packages from the SCL repository need to be installed." - if ! $TOOL list centos-release-scl >/dev/null 2>&1; then + if ! "${TOOL}" list rh-python36 >/dev/null 2>&1; then + echo "To use Certbot on this operating system, packages from the SCL repository need to be installed." + if ! "${TOOL}" list centos-release-scl >/dev/null 2>&1; then error "Enable the SCL repository and try running Certbot again." exit 1 fi - if [ "$ASSUME_YES" = 1 ]; then - /bin/echo -n "Enabling the SCL repository in 3 seconds..." + if [ "${ASSUME_YES}" = 1 ]; then + /bin/echo -n "Enabling the SCL repository in 3 seconds... (Press Ctrl-C to cancel)" sleep 1s - /bin/echo -ne "\e[0K\rEnabling the SCL repository in 2 seconds..." + /bin/echo -ne "\e[0K\rEnabling the SCL repository in 2 seconds... (Press Ctrl-C to cancel)" sleep 1s - /bin/echo -e "\e[0K\rEnabling the SCL repository in 1 second..." + /bin/echo -e "\e[0K\rEnabling the SCL repository in 1 second... (Press Ctrl-C to cancel)" sleep 1s fi - if ! $TOOL install $YES_FLAG $QUIET_FLAG centos-release-scl; then + if ! "${TOOL}" install "${YES_FLAG}" "${QUIET_FLAG}" centos-release-scl; then error "Could not enable SCL. Aborting bootstrap!" exit 1 fi fi # CentOS 6 must use rh-python36 from SCL - if $TOOL list rh-python36 >/dev/null 2>&1; then + if "${TOOL}" list rh-python36 >/dev/null 2>&1; then python_pkgs="rh-python36-python rh-python36-python-virtualenv rh-python36-python-devel @@ -529,7 +529,7 @@ BootstrapRpmPython3Legacy() { exit 1 fi - BootstrapRpmCommonBase "$python_pkgs" + BootstrapRpmCommonBase "${python_pkgs}" } # If new packages are installed by BootstrapRpmPython3 below, this version @@ -800,7 +800,7 @@ elif [ -f /etc/redhat-release ]; then fi if [ "$PYVER" -eq 26 ]; then Bootstrap() { - BootstrapMessage "Legacy RedHat-based OSes that will use Python3" + BootstrapMessage "Legacy Red Hat-based OSes that will use Python3" BootstrapRpmPython3Legacy } USE_PYTHON_3=1 @@ -809,14 +809,14 @@ elif [ -f /etc/redhat-release ]; then PATH="/opt/rh/rh-python36/root/usr/bin:$PATH" elif [ "$RPM_DIST_NAME" = "fedora" -a "$RPM_DIST_VERSION" -ge 29 -o "$PYVER" -eq 26 ]; then Bootstrap() { - BootstrapMessage "RedHat-based OSes that will use Python3" + BootstrapMessage "Red Hat-based OSes that will use Python3" BootstrapRpmPython3 } USE_PYTHON_3=1 BOOTSTRAP_VERSION="BootstrapRpmPython3 $BOOTSTRAP_RPM_PYTHON3_VERSION" else Bootstrap() { - BootstrapMessage "RedHat-based OSes" + BootstrapMessage "Red Hat-based OSes" BootstrapRpmCommon } BOOTSTRAP_VERSION="BootstrapRpmCommon $BOOTSTRAP_RPM_COMMON_VERSION" diff --git a/letsencrypt-auto-source/letsencrypt-auto.template b/letsencrypt-auto-source/letsencrypt-auto.template index 2d804bf2a..368520eb8 100755 --- a/letsencrypt-auto-source/letsencrypt-auto.template +++ b/letsencrypt-auto-source/letsencrypt-auto.template @@ -339,7 +339,7 @@ elif [ -f /etc/redhat-release ]; then fi if [ "$PYVER" -eq 26 ]; then Bootstrap() { - BootstrapMessage "Legacy RedHat-based OSes that will use Python3" + BootstrapMessage "Legacy Red Hat-based OSes that will use Python3" BootstrapRpmPython3Legacy } USE_PYTHON_3=1 @@ -348,14 +348,14 @@ elif [ -f /etc/redhat-release ]; then PATH="/opt/rh/rh-python36/root/usr/bin:$PATH" elif [ "$RPM_DIST_NAME" = "fedora" -a "$RPM_DIST_VERSION" -ge 29 -o "$PYVER" -eq 26 ]; then Bootstrap() { - BootstrapMessage "RedHat-based OSes that will use Python3" + BootstrapMessage "Red Hat-based OSes that will use Python3" BootstrapRpmPython3 } USE_PYTHON_3=1 BOOTSTRAP_VERSION="BootstrapRpmPython3 $BOOTSTRAP_RPM_PYTHON3_VERSION" else Bootstrap() { - BootstrapMessage "RedHat-based OSes" + BootstrapMessage "Red Hat-based OSes" BootstrapRpmCommon } BOOTSTRAP_VERSION="BootstrapRpmCommon $BOOTSTRAP_RPM_COMMON_VERSION" diff --git a/letsencrypt-auto-source/pieces/bootstrappers/rpm_common_base.sh b/letsencrypt-auto-source/pieces/bootstrappers/rpm_common_base.sh index 326ad8b3f..cc11c1ee2 100644 --- a/letsencrypt-auto-source/pieces/bootstrappers/rpm_common_base.sh +++ b/letsencrypt-auto-source/pieces/bootstrappers/rpm_common_base.sh @@ -25,17 +25,17 @@ InitializeRPMCommonBase() { fi if ! $TOOL list *virtualenv >/dev/null 2>&1; then - echo "To use Certbot, packages from the EPEL repository need to be installed." + echo "To use Certbot on this operating system, packages from the EPEL repository need to be installed." if ! $TOOL list epel-release >/dev/null 2>&1; then error "Enable the EPEL repository and try running Certbot again." exit 1 fi if [ "$ASSUME_YES" = 1 ]; then - /bin/echo -n "Enabling the EPEL repository in 3 seconds..." + /bin/echo -n "Enabling the EPEL repository in 3 seconds... (Press Ctrl-C to cancel)" sleep 1s - /bin/echo -ne "\e[0K\rEnabling the EPEL repository in 2 seconds..." + /bin/echo -ne "\e[0K\rEnabling the EPEL repository in 2 seconds... (Press Ctrl-C to cancel)" sleep 1s - /bin/echo -e "\e[0K\rEnabling the EPEL repository in 1 second..." + /bin/echo -e "\e[0K\rEnabling the EPEL repository in 1 second... (Press Ctrl-C to cancel)" sleep 1s fi if ! $TOOL install $YES_FLAG $QUIET_FLAG epel-release; then diff --git a/letsencrypt-auto-source/pieces/bootstrappers/rpm_python3_legacy.sh b/letsencrypt-auto-source/pieces/bootstrappers/rpm_python3_legacy.sh index db0d7b955..10e1eddd8 100644 --- a/letsencrypt-auto-source/pieces/bootstrappers/rpm_python3_legacy.sh +++ b/letsencrypt-auto-source/pieces/bootstrappers/rpm_python3_legacy.sh @@ -8,28 +8,28 @@ BootstrapRpmPython3Legacy() { InitializeRPMCommonBase - if ! $TOOL list rh-python36 >/dev/null 2>&1; then - echo "To use Certbot, packages from the SCL repository need to be installed." - if ! $TOOL list centos-release-scl >/dev/null 2>&1; then + if ! "${TOOL}" list rh-python36 >/dev/null 2>&1; then + echo "To use Certbot on this operating system, packages from the SCL repository need to be installed." + if ! "${TOOL}" list centos-release-scl >/dev/null 2>&1; then error "Enable the SCL repository and try running Certbot again." exit 1 fi - if [ "$ASSUME_YES" = 1 ]; then - /bin/echo -n "Enabling the SCL repository in 3 seconds..." + if [ "${ASSUME_YES}" = 1 ]; then + /bin/echo -n "Enabling the SCL repository in 3 seconds... (Press Ctrl-C to cancel)" sleep 1s - /bin/echo -ne "\e[0K\rEnabling the SCL repository in 2 seconds..." + /bin/echo -ne "\e[0K\rEnabling the SCL repository in 2 seconds... (Press Ctrl-C to cancel)" sleep 1s - /bin/echo -e "\e[0K\rEnabling the SCL repository in 1 second..." + /bin/echo -e "\e[0K\rEnabling the SCL repository in 1 second... (Press Ctrl-C to cancel)" sleep 1s fi - if ! $TOOL install $YES_FLAG $QUIET_FLAG centos-release-scl; then + if ! "${TOOL}" install "${YES_FLAG}" "${QUIET_FLAG}" centos-release-scl; then error "Could not enable SCL. Aborting bootstrap!" exit 1 fi fi # CentOS 6 must use rh-python36 from SCL - if $TOOL list rh-python36 >/dev/null 2>&1; then + if "${TOOL}" list rh-python36 >/dev/null 2>&1; then python_pkgs="rh-python36-python rh-python36-python-virtualenv rh-python36-python-devel @@ -39,5 +39,5 @@ BootstrapRpmPython3Legacy() { exit 1 fi - BootstrapRpmCommonBase "$python_pkgs" + BootstrapRpmCommonBase "${python_pkgs}" }