From: Lukas Schauer Date: Tue, 15 Dec 2015 23:50:42 +0000 (+0100) Subject: handle whitespace in domains.txt a bit different to be compatible with bsd sed, hopef... X-Git-Tag: v0.1.0~123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d787f3814501cf0acfb053a0b7d0b9d661aded2;p=thirdparty%2Fdehydrated.git handle whitespace in domains.txt a bit different to be compatible with bsd sed, hopefully fixes #45 --- diff --git a/letsencrypt.sh b/letsencrypt.sh index 9bc25a3..a59f073 100755 --- a/letsencrypt.sh +++ b/letsencrypt.sh @@ -407,7 +407,7 @@ command_sign_domains() { echo "${PARAM_DOMAIN}" > "${DOMAINS_TXT}" fi # Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire - <"${DOMAINS_TXT}" sed 's/^\s*//g;s/\s*$//g' | grep -v '^#' | grep -v '^$' | while read -r line; do + <"${DOMAINS_TXT}" sed 's/^[ ]*//g;s/[ ]*$//g' | grep -v '^#' | grep -v '^$' | while read -r line; do domain="$(printf '%s\n' "${line}" | cut -d' ' -f1)" morenames="$(printf '%s\n' "${line}" | cut -s -d' ' -f2-)" cert="${BASEDIR}/certs/${domain}/cert.pem"