главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
path: root/get-cert.sh
diff options
context:
space:
mode:
Diffstat (limited to 'get-cert.sh')
-rwxr-xr-xget-cert.sh24
1 files changed, 19 insertions, 5 deletions
diff --git a/get-cert.sh b/get-cert.sh
index a5b9f81..ef9d3ed 100755
--- a/get-cert.sh
+++ b/get-cert.sh
@@ -1,7 +1,21 @@
-# Setup TLS with certbot and Let's Encrypt
-# https://certbot.eff.org/
+#!/bin/sh
-sudo apt install certbot python3-certbot-nginx
-sudo certbot --nginx
-sudo certbot renew --dry-run
+if [ -f .env ]; then
+ . ./.env
+else
+ . ./.env.example
+fi
+# ---
+
+echo 'Installing Certbot...'
+apt-get install -y certbot python3-certbot-nginx
+
+if ![$LT_DOMAIN = "_" ]; then
+ certbot --nginx -d $LT_DOMAIN
+else
+ echo 'Please set the $LT_DOMAIN variable in the .env file to your domain name.'
+ exit 1
+fi
+
+echo 'Done! Now you have SSL enabled on your LibreTranslate instance.'