From b5b1d5911b069f6635816277f5ea2ec3381bcc3c Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Thu, 21 Sep 2023 18:32:34 +0100 Subject: [PATCH] Remove stray esac and adjust indentation --- xmpp-wizard.sh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/xmpp-wizard.sh b/xmpp-wizard.sh index 41b04d1..e5792c2 100644 --- a/xmpp-wizard.sh +++ b/xmpp-wizard.sh @@ -18,19 +18,17 @@ index=0 for vhost in ${domains[@]}; do # for each vhost [ ! -d "$certdir[$index]" ] && # if default cert dir for the vhost doesn't exist certdir[$index]=$(certbot certificates 2>/dev/null | grep "Domains:.* \(\*\.$domain\|$vhost\)\(\s\|$\)" -A 2 | awk '/Certificate Path/ {print $3}' | head -n1) # set cert dir for certificate - ((index++)) - - [ ! -d "$certdir[$index]" ] && # if there is no certificate for the domain - if [ systemctl is-active --quiet nginx ] - then - pacman -S --noconfirm python3-certbot-nginx - certbot -d "$vhost" certonly --nginx --register-unsafely-without-email --agree-tos # request cert with nginx - else - pacman -S --noconfirm certbot - certbot -d "$vhost" certonly --standalone --register-unsafely-without-email --agree-tos # request cert with certbot - fi - esac + ((index++)) + [ ! -d "$certdir[$index]" ] && # if there is no certificate for the domain + if [ systemctl is-active --quiet nginx ] + then + pacman -S --noconfirm python3-certbot-nginx + certbot -d "$vhost" certonly --nginx --register-unsafely-without-email --agree-tos # request cert with nginx + else + pacman -S --noconfirm certbot + certbot -d "$vhost" certonly --standalone --register-unsafely-without-email --agree-tos # request cert with certbot + fi [ ! -d "$certdir[$index]" ] && echo "Error locating or installing SSL certificate." && exit 1 done