From: Lukas Schauer Date: Sat, 13 Jan 2018 19:54:55 +0000 (+0100) Subject: fixed domains.txt parsing (theoretically compatible with wildcard domains) X-Git-Tag: v0.6.0~43 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3e521e1c0128d67473ad0c77641b68fb974b4cbb;p=thirdparty%2Fdehydrated.git fixed domains.txt parsing (theoretically compatible with wildcard domains) --- diff --git a/dehydrated b/dehydrated index 00dd321..1f8a311 100755 --- a/dehydrated +++ b/dehydrated @@ -1075,7 +1075,9 @@ command_sign_domains() { # Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire ORIGIFS="${IFS}" IFS=$'\n' - for line in "$(<"${DOMAINS_TXT}" tr -d '\r' | awk '{print tolower($0)}' | _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' -e 's/([^ ])>/\1 >/g' -e 's/> />/g' | (grep -vE '^(#|$)' || true))"; do + [[ -n "${ZSH_VERSION:-}" ]] && set -o noglob || set -f + for line in $(<"${DOMAINS_TXT}" tr -d '\r' | awk '{print tolower($0)}' | _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' -e 's/([^ ])>/\1 >/g' -e 's/> />/g' | (grep -vE '^(#|$)' || true)); do + [[ -n "${ZSH_VERSION:-}" ]] && set +o noglob || set +f reset_configvars IFS="${ORIGIFS}" alias="$(grep -Eo '>[^ ]+' <<< "${line}" || true)" @@ -1187,12 +1189,14 @@ command_sign_domains() { # shellcheck disable=SC2086 if [[ ! "${skip}" = "yes" ]]; then update_ocsp="yes" + [[ -n "${ZSH_VERSION:-}" ]] && set -o noglob || set -f if [[ "${PARAM_KEEP_GOING:-}" = "yes" ]]; then sign_domain "${certdir}" ${domain} ${morenames} & wait $! || true else sign_domain "${certdir}" ${domain} ${morenames} fi + [[ -n "${ZSH_VERSION:-}" ]] && set +o noglob || set +f fi if [[ "${OCSP_FETCH}" = "yes" ]]; then @@ -1219,6 +1223,7 @@ command_sign_domains() { fi fi done + [[ -n "${ZSH_VERSION:-}" ]] && set +o noglob || set +f reset_configvars # remove temporary domains.txt file if used