From 69e4f35d9aa72f1f9956c9c8a283414a1c98ffb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Mon, 7 Jan 2019 19:50:04 +0200 Subject: [PATCH] Test and exit for jq error before domain loop --- contrib/scripts/dumpcerts.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/scripts/dumpcerts.sh b/contrib/scripts/dumpcerts.sh index 42f465630..c5c007cdb 100755 --- a/contrib/scripts/dumpcerts.sh +++ b/contrib/scripts/dumpcerts.sh @@ -155,7 +155,8 @@ echo -e "-----BEGIN RSA PRIVATE KEY-----\n${priv}\n-----END RSA PRIVATE KEY----- | openssl rsa -inform pem -out "${pdir}/letsencrypt.key" # Process the certificates for each of the domains in acme.json -for domain in $(jq -r '.Certificates[].Domain.Main' ${acmefile}); do +domains=$(jq -r '.Certificates[].Domain.Main' ${acmefile}) || bad_acme +for domain in $domains; do # Traefik stores a cert bundle for each domain. Within this cert # bundle there is both proper the certificate and the Let's Encrypt CA echo "Extracting cert bundle for ${domain}"