Refactor bash [[ ... ]] && ... || ... into if then else
This commit is contained in:
parent
c020cc88a1
commit
ad4d4cc794
|
@ -1095,7 +1095,16 @@ function _setup_ssl
|
||||||
local LETSENCRYPT_DOMAIN=""
|
local LETSENCRYPT_DOMAIN=""
|
||||||
local LETSENCRYPT_KEY=""
|
local LETSENCRYPT_KEY=""
|
||||||
|
|
||||||
[[ -f /etc/letsencrypt/acme.json ]] && (_extract_certs_from_acme "${SSL_DOMAIN}" || _extract_certs_from_acme "${HOSTNAME}" || _extract_certs_from_acme "${DOMAINNAME}")
|
if [[ -f /etc/letsencrypt/acme.json ]]
|
||||||
|
then
|
||||||
|
if ! _extract_certs_from_acme "${SSL_DOMAIN}"
|
||||||
|
then
|
||||||
|
if ! _extract_certs_from_acme "${HOSTNAME}"
|
||||||
|
then
|
||||||
|
_extract_certs_from_acme "${DOMAINNAME}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# first determine the letsencrypt domain by checking both the full hostname or just the domainname if a SAN is used in the cert
|
# first determine the letsencrypt domain by checking both the full hostname or just the domainname if a SAN is used in the cert
|
||||||
if [[ -e /etc/letsencrypt/live/${HOSTNAME}/fullchain.pem ]]
|
if [[ -e /etc/letsencrypt/live/${HOSTNAME}/fullchain.pem ]]
|
||||||
|
|
Loading…
Reference in New Issue