diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-04-01 19:14:20 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-04-01 19:14:20 +0200 |
commit | bc83b07e4aa4c68f63f4e1b9f6f00757388ea13c (patch) | |
tree | ccb9a45430645ea80bca1b3717e453e254229a0e /examples/tg16/letsencrypt-tg16.sh | |
parent | 1d2470a411e5eaac7e5a1c5d5b6b81e92c92f4a8 (diff) | |
parent | 3dc8afb739a03459393d3cda79bd16cefff15cae (diff) |
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'examples/tg16/letsencrypt-tg16.sh')
-rw-r--r-- | examples/tg16/letsencrypt-tg16.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/tg16/letsencrypt-tg16.sh b/examples/tg16/letsencrypt-tg16.sh new file mode 100644 index 0000000..03510b4 --- /dev/null +++ b/examples/tg16/letsencrypt-tg16.sh @@ -0,0 +1,16 @@ +#!/bin/bash + + openssl req -new -sha256 -key /root/le/keys/domain.key -subj "/" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:yoda.tg16.gathering.org,DNS:stream.tg16.gathering.org,DNS:streams.tg16.gathering.org,DNS:webcam.tg16.gathering.org,DNS:webcams.tg16.gathering.org,DNS:nms.tg16.gathering.org,DNS:nms-public.tg16.gathering.org,DNS:stats.tg16.gathering.org,DNS:nms-api.tg16.gathering.org")) > /root/le/csrs/yoda.csr + python /root/le/acme-tiny/acme_tiny.py --account-key /root/le/keys/account.key --csr /root/le/csrs/yoda.csr --acme-dir /var/www/html/.well-known/acme-challenge > /root/le/certs/yoda.crt + if [ $? -ne 0 ]; then + echo "Client exited with error, not overwriting cert" + else + cp /root/le/certs/yoda.crt /root/le/prodcerts/yoda.prod.crt + fi + +curl https://letsencrypt.org/certs/lets-encrypt-x1-cross-signed.pem > /root/le/letsencrypt.ca-bundle.temp +if [ $? -ne 0 ]; then +echo "Client exited with error, not overwriting cert" +else +mv /root/le/letsencrypt.ca-bundle.temp /root/le/letsencrypt.ca-bundle +fi |