aboutsummaryrefslogtreecommitdiffstats
path: root/examples/tg16/letsencrypt-tg16.sh
diff options
context:
space:
mode:
authorJoachim Tingvold <joachim@tingvold.com>2016-03-29 23:57:35 +0200
committerJoachim Tingvold <joachim@tingvold.com>2016-03-29 23:57:35 +0200
commitfefa87ebf2b2e001a18666e0eb160cb84282f5ba (patch)
tree55236e0398f602e024ce4f07341812544bd945c3 /examples/tg16/letsencrypt-tg16.sh
parent69722b70c1f07fd728388e8dcd2c3440ca4468be (diff)
TG16-config.
Diffstat (limited to 'examples/tg16/letsencrypt-tg16.sh')
-rw-r--r--examples/tg16/letsencrypt-tg16.sh16
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