From b50fb342f12ad6a0bc296bc9f80afa82a859868f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 6 Dec 2020 20:42:56 -0500 Subject: [PATCH] detect wildcard certs, fix #98 --- emailwiz.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emailwiz.sh b/emailwiz.sh index 20685ea..96e3977 100755 --- a/emailwiz.sh +++ b/emailwiz.sh @@ -42,7 +42,7 @@ subdom="mail" maildomain="$subdom.$domain" certdir="/etc/letsencrypt/live/$maildomain" -[ ! -d "$certdir" ] && certdir="$(dirname "$(certbot certificates 2>/dev/null | grep "$maildomain" -A 2 | awk '/Certificate Path/ {print $3}')")" +[ ! -d "$certdir" ] && certdir="$(dirname "$(certbot certificates 2>/dev/null | grep "$maildomain\|*.$domain" -A 2 | awk '/Certificate Path/ {print $3}' | head -n1)")" [ ! -d "$certdir" ] && echo "Note! You must first have a Let's Encrypt Certbot HTTPS/SSL Certificate for $maildomain.