Something consumes stdin when sign_domain is called.
As a result the DOMAINS_TXT loop has nothing to read anymore and exists after the first certificate has been signed.
The following patch fixes this bug for me but may be overly complicated (I'm not that fluent in shell code):
diff --git a/letsencrypt.sh b/letsencrypt.sh
index c60ea5b..4727307 100755
--- a/letsencrypt.sh
+++ b/letsencrypt.sh
@@ -553,8 +553,13 @@ command_sign_domains() {
_exiterr "domains.txt not found and --domain not given"
fi
+ DOMAINS_ARR=()
+ while read -r line; do
+ DOMAINS_ARR+=("${line}")
+ done < <(<"${DOMAINS_TXT}" _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' | (grep -vE '^(#|$)' || true))
+
# Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire
- <"${DOMAINS_TXT}" _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' | (grep -vE '^(#|$)' || true) | while read -r line; do
+ for line in "${DOMAINS_ARR[@]}"; do
domain="$(printf '%s\n' "${line}" | cut -d' ' -f1)"
morenames="$(printf '%s\n' "${line}" | cut -s -d' ' -f2-)"
cert="${BASEDIR}/certs/${domain}/cert.pem"
@debfx commented on GitHub (Feb 20, 2016):
Something consumes stdin when sign_domain is called.
As a result the DOMAINS_TXT loop has nothing to read anymore and exists after the first certificate has been signed.
The following patch fixes this bug for me but may be overly complicated (I'm not that fluent in shell code):
``` diff
diff --git a/letsencrypt.sh b/letsencrypt.sh
index c60ea5b..4727307 100755
--- a/letsencrypt.sh
+++ b/letsencrypt.sh
@@ -553,8 +553,13 @@ command_sign_domains() {
_exiterr "domains.txt not found and --domain not given"
fi
+ DOMAINS_ARR=()
+ while read -r line; do
+ DOMAINS_ARR+=("${line}")
+ done < <(<"${DOMAINS_TXT}" _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' | (grep -vE '^(#|$)' || true))
+
# Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire
- <"${DOMAINS_TXT}" _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' | (grep -vE '^(#|$)' || true) | while read -r line; do
+ for line in "${DOMAINS_ARR[@]}"; do
domain="$(printf '%s\n' "${line}" | cut -d' ' -f1)"
morenames="$(printf '%s\n' "${line}" | cut -s -d' ' -f2-)"
cert="${BASEDIR}/certs/${domain}/cert.pem"
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @debfx on GitHub (Feb 20, 2016).
In --cron mode letsencrypt.sh stops after creating the first non-existant certificate.
Say domains.txt contains:
If the test1 cert exists and hasn't expired, letsencrypt.sh creates a certificate for test2 and then just stops.
Trace:
Tested with revision
63a4937658@debfx commented on GitHub (Feb 20, 2016):
Something consumes stdin when sign_domain is called.
As a result the DOMAINS_TXT loop has nothing to read anymore and exists after the first certificate has been signed.
The following patch fixes this bug for me but may be overly complicated (I'm not that fluent in shell code):
@lukas2511 commented on GitHub (Feb 20, 2016):
Can you check if the mentioned commit fixes your problem?
@debfx commented on GitHub (Feb 20, 2016):
Yes, works fine. Thanks!