Browse Source

fix: Fixes Let's Encrypt script. (#11430)

* fix: Fixes Let's Encrypt script.

It fails when certbot is not installed and exits with an error without installing anything.

* squash: Fixes certbot command after install.
master
Дамян Минков 3 years ago
parent
commit
037b9202a6
No account linked to committer's email address
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      resources/install-letsencrypt-cert.sh

+ 3
- 1
resources/install-letsencrypt-cert.sh View File

@@ -23,7 +23,7 @@ echo "by providing an email address for important account notifications"
23 23
 echo -n "Enter your email and press [ENTER]: "
24 24
 read EMAIL
25 25
 
26
-CERTBOT="$(command -v certbot)"
26
+CERTBOT="$(command -v certbot || true)"
27 27
 if [ ! -x "$CERTBOT" ] ; then
28 28
     DISTRO=$(lsb_release -is)
29 29
     DISTRO_VERSION=$(lsb_release -rs)
@@ -50,6 +50,8 @@ if [ ! -x "$CERTBOT" ] ; then
50 50
         echo "Only Debian 9,10 and Ubuntu 18.04,19.10,20.04 are supported"
51 51
         exit 1
52 52
     fi
53
+    
54
+    CERTBOT="$(command -v certbot)"
53 55
 fi
54 56
 
55 57
 CRON_FILE="/etc/cron.weekly/letsencrypt-renew"

Loading…
Cancel
Save