From b901b9d3ec9b99e377497127812d12f4ad72fe2d Mon Sep 17 00:00:00 2001 From: srvrco Date: Tue, 3 Jan 2017 13:49:47 +0000 Subject: [PATCH] dont loop over domains for DNS_ADD_COMMAND check --- getssl | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/getssl b/getssl index 522f0bd..ea8a012 100755 --- a/getssl +++ b/getssl @@ -315,6 +315,17 @@ check_config() { # check the config files for all obvious errors alldomains=$(echo "$DOMAIN,$SANS" | sed "s/,/ /g") fi + if [[ $VALIDATE_VIA_DNS == "true" ]]; then # using dns-01 challenge + if [[ -z "$DNS_ADD_COMMAND" ]]; then + info "DNS_ADD_COMMAND not defined (whilst VALIDATE_VIA_DNS=true)" + config_errors=true + fi + if [[ -z "$DNS_DEL_COMMAND" ]]; then + info "DNS_DEL_COMMAND not defined (whilst VALIDATE_VIA_DNS=true)" + config_errors=true + fi + fi + dn=0 tmplist=$(mktemp) for d in $alldomains; do # loop over domains (dn is domain number) @@ -331,16 +342,7 @@ check_config() { # check the config files for all obvious errors DOMAIN_ACL="${ACL[$dn]}" fi - if [[ $VALIDATE_VIA_DNS == "true" ]]; then # using dns-01 challenge - if [[ -z "$DNS_ADD_COMMAND" ]]; then - info "DNS_ADD_COMMAND not defined for $d" - config_errors=true - fi - if [[ -z "$DNS_DEL_COMMAND" ]]; then - info "DNS_DEL_COMMAND not defined for $d" - config_errors=true - fi - else # not using dns-01 challenge - using http-01 challenge + if [[ $VALIDATE_VIA_DNS != "true" ]]; then # using http-01 challenge if [[ -z "${DOMAIN_ACL}" ]]; then info "ACL location not specified for domain $d in $DOMAIN_DIR/getssl.cfg" config_errors=true @@ -354,7 +356,7 @@ check_config() { # check the config files for all obvious errors info "DNS lookup failed for $d" config_errors=true fi - fi # end of dns-01 http-01 check + fi # end http-01 check ((dn++)) done