add code to check for aliases and redirects
This commit is contained in:
parent
620b1ca2a1
commit
c36989b5ed
@ -16,17 +16,30 @@ if [[ -d /var/tmp/letsencrypt/ ]]; then
|
|||||||
do
|
do
|
||||||
rm /var/tmp/letsencrypt/$domain
|
rm /var/tmp/letsencrypt/$domain
|
||||||
if /usr/local/bin/letsencrypt-certonly.sh -d $domain ; then
|
if /usr/local/bin/letsencrypt-certonly.sh -d $domain ; then
|
||||||
|
# check for Mail domain
|
||||||
if [[ "$domain" =~ ^mail.* ]]; then
|
if [[ "$domain" =~ ^mail.* ]]; then
|
||||||
vmaildomain="${domain/mail./}"
|
vmaildomain="${domain/mail./}"
|
||||||
if [[ -d /var/vmail/$vmaildomain ]]; then
|
if [[ -d /var/vmail/$vmaildomain ]]; then
|
||||||
/usr/local/bin/vmail-dovecot-enable.sh -d $vmaildomain
|
/usr/local/bin/vmail-dovecot-enable.sh -d $vmaildomain
|
||||||
/usr/local/bin/vhost-enable.sh -d $domain -m VMailHTTPS
|
/usr/local/bin/vhost-enable.sh -d $domain -m VMailHTTPS
|
||||||
fi
|
fi
|
||||||
|
# check for VHost
|
||||||
elif [[ -d /srv/www/$domain ]]; then
|
elif [[ -d /srv/www/$domain ]]; then
|
||||||
/usr/local/bin/vhost-enable.sh -d $domain -m VHostHTTPS
|
/usr/local/bin/vhost-enable.sh -d $domain -m VHostHTTPS
|
||||||
|
# check for configured VHostAliasHTTP, RedirectHTTP, VHostSubdomainHTTP
|
||||||
|
elif [[ -f /etc/apache2/sites-available/$domain.conf ]]; then
|
||||||
|
if head -n 1 /etc/apache2/sites-available/$domain.conf |grep --quiet "^Use .*HTTP "; then
|
||||||
|
sed -i "s|HTTP |HTTPS |g" /etc/apache2/sites-available/$domain.conf
|
||||||
|
if [[ -h /etc/apache2/sites-enabled/$domain.conf ]]; then
|
||||||
|
# modify timestamp on existing symlink to trigger apache restart
|
||||||
|
touch --no-dereference /etc/apache2/sites-enabled/$domain.conf
|
||||||
|
else
|
||||||
|
# Alias/Redirect/Subdomain site was configured but not enabled, enable now
|
||||||
|
a2ensite --quiet $domain.conf
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# add code to check for aliases and redirects?
|
|
||||||
# run once and exit, script will be restarted if additional domains are still queued for cert deployment
|
# run once and exit, script will be restarted if additional domains are still queued for cert deployment
|
||||||
exit 0
|
exit 0
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user