Explorar el Código

fix: Fixes let's encrypt for latest ubuntu versions. (#11434)

* fix: Fixes let's encrypt for latest ubuntu versions.

* squash: Simplifies the logic.
master
Дамян Минков hace 3 años
padre
commit
0ae2693116
No account linked to committer's email address
Se han modificado 1 ficheros con 16 adiciones y 21 borrados
  1. 16
    21
      resources/install-letsencrypt-cert.sh

+ 16
- 21
resources/install-letsencrypt-cert.sh Ver fichero

@@ -27,30 +27,25 @@ CERTBOT="$(command -v certbot || true)"
27 27
 if [ ! -x "$CERTBOT" ] ; then
28 28
     DISTRO=$(lsb_release -is)
29 29
     DISTRO_VERSION=$(lsb_release -rs)
30
-    if [ "$DISTRO" = "Debian" ]; then
31
-        apt-get update
32
-        apt-get -y install certbot
33
-    elif [ "$DISTRO" = "Ubuntu" ]; then
34
-        if [ "$DISTRO_VERSION" = "20.04" ] || [ "$DISTRO_VERSION" = "19.10" ]; then
35
-                apt-get update
36
-                apt-get -y install software-properties-common
37
-                add-apt-repository -y universe
38
-                apt-get update
39
-                apt-get -y install certbot
40
-        elif [ "$DISTRO_VERSION" = "18.04" ]; then
41
-                apt-get update
42
-                apt-get -y install software-properties-common
43
-                add-apt-repository -y universe
44
-                add-apt-repository -y ppa:certbot/certbot
45
-                apt-get update
46
-                apt-get -y install certbot
47
-        fi
48
-    else
30
+
31
+    if [ "$DISTRO" != "Debian" ] && [ "$DISTRO" != "Ubuntu" ]; then
49 32
         echo "$DISTRO $DISTRO_VERSION is not supported"
50
-        echo "Only Debian 9,10 and Ubuntu 18.04,19.10,20.04 are supported"
33
+        echo "Only Debian and Ubuntu 18.04+ are supported"
51 34
         exit 1
52 35
     fi
53
-    
36
+
37
+    if [ "$DISTRO" = "Ubuntu" ]; then
38
+        apt-get update
39
+        apt-get -y install software-properties-common
40
+        add-apt-repository -y universe
41
+        if [ "$DISTRO_VERSION" = "18.04" ]; then
42
+            add-apt-repository -y ppa:certbot/certbot
43
+        fi
44
+    fi
45
+
46
+    apt-get update
47
+    apt-get -y install certbot
48
+
54 49
     CERTBOT="$(command -v certbot)"
55 50
 fi
56 51
 

Loading…
Cancelar
Guardar