diff --git a/resources/install-letsencrypt-cert.sh b/resources/install-letsencrypt-cert.sh index a73b5ca7a..10985b502 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