Browse Source

cron example: do not write the certificate if there is an error

Benoit Garret 9 years ago
parent
commit
a9a7170c5a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      README.md

+ 2 - 1
README.md

@@ -143,7 +143,8 @@ for example script).
 Example of a `renew_cert.sh`:
 ```sh
 #!/usr/bin/sh
-python /path/to/acme_tiny.py --account-key /path/to/account.key --csr /path/to/domain.csr --acme-dir /var/www/challenges/ > /path/to/signed.crt
+CERT=python /path/to/acme_tiny.py --account-key /path/to/account.key --csr /path/to/domain.csr --acme-dir /var/www/challenges/ || exit
+echo $CERT > /path/to/signed.crt
 wget -O - https://letsencrypt.org/certs/lets-encrypt-x1-cross-signed.pem > intermediate.pem
 cat /path/to/signed.crt intermediate.pem > /path/to/chained.pem
 service nginx reload