summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2023-01-26 19:51:36 -0500
committerLuke Smith <luke@lukesmith.xyz>2023-01-26 19:51:36 -0500
commit548d54794917713f71dbf97d1174ba1f73499b96 (patch)
treeb976845a17435eca605af738b3feaf8cfdb69848
parent1793233157b08f5e1f760f4c72b4ba25b9f15bd6 (diff)
it makes elegant sense in my head
-rw-r--r--emailwiz.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/emailwiz.sh b/emailwiz.sh
index fac8671..f6d6dfa 100644
--- a/emailwiz.sh
+++ b/emailwiz.sh
@@ -52,7 +52,9 @@ done
possiblecert="$(certbot certificates 2>/dev/null | grep "Domains:\.* $maildomain\(\s\|$\)" -A 2 | awk '/Certificate Path/ {print $3}' | head -n1)" &&
certdir="${possiblecert%/*}"
-[ ! -d "$certdir" ] && case "$(netstat -tulpn | grep ":80\s")" in
+[ ! -d "$certdir" ] &&
+ certdir="/etc/letsencrypt/live/$maildomain" &&
+ case "$(netstat -tulpn | grep ":80\s")" in
*nginx*)
apt install -y python3-certbot-nginx
certbot -d "$maildomain" certonly --nginx --register-unsafely-without-email --agree-tos