From 0ae269311600c8d3cad9ad13d86eaa2b709299cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Tue, 26 Apr 2022 13:48:25 -0500 Subject: [PATCH] fix: Fixes let's encrypt for latest ubuntu versions. (#11434) * fix: Fixes let's encrypt for latest ubuntu versions. * squash: Simplifies the logic. --- resources/install-letsencrypt-cert.sh | 37 ++++++++++++--------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/resources/install-letsencrypt-cert.sh b/resources/install-letsencrypt-cert.sh index a73b5ca7a1..10985b502c 100755 --- a/resources/install-letsencrypt-cert.sh +++ b/resources/install-letsencrypt-cert.sh @@ -27,30 +27,25 @@ CERTBOT="$(command -v certbot || true)" if [ ! -x "$CERTBOT" ] ; then DISTRO=$(lsb_release -is) DISTRO_VERSION=$(lsb_release -rs) - if [ "$DISTRO" = "Debian" ]; then - apt-get update - apt-get -y install certbot - elif [ "$DISTRO" = "Ubuntu" ]; then - if [ "$DISTRO_VERSION" = "20.04" ] || [ "$DISTRO_VERSION" = "19.10" ]; then - apt-get update - apt-get -y install software-properties-common - add-apt-repository -y universe - apt-get update - apt-get -y install certbot - elif [ "$DISTRO_VERSION" = "18.04" ]; then - apt-get update - apt-get -y install software-properties-common - add-apt-repository -y universe - add-apt-repository -y ppa:certbot/certbot - apt-get update - apt-get -y install certbot - fi - else + + if [ "$DISTRO" != "Debian" ] && [ "$DISTRO" != "Ubuntu" ]; then echo "$DISTRO $DISTRO_VERSION is not supported" - echo "Only Debian 9,10 and Ubuntu 18.04,19.10,20.04 are supported" + echo "Only Debian and Ubuntu 18.04+ are supported" exit 1 fi - + + if [ "$DISTRO" = "Ubuntu" ]; then + apt-get update + apt-get -y install software-properties-common + add-apt-repository -y universe + if [ "$DISTRO_VERSION" = "18.04" ]; then + add-apt-repository -y ppa:certbot/certbot + fi + fi + + apt-get update + apt-get -y install certbot + CERTBOT="$(command -v certbot)" fi