From 81eb00d4e52f7840f5c3ad2e74fb0864f29479fc Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Sat, 30 Sep 2017 18:18:00 +0200
Subject: [PATCH] expand certbot

---
 expandCertbot.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 expandCertbot.sh

diff --git a/expandCertbot.sh b/expandCertbot.sh
new file mode 100644
index 0000000..98d9d8d
--- /dev/null
+++ b/expandCertbot.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+if [ -z "$2" ]
+then
+	echo "usage $0 additional-dommains certificate"
+	echo "additional-domains : comma separated list of domains"
+	echo "expand the existing certificate with the given domains"
+	exit 1
+fi
+domains="`openssl x509  -in $2 -inform pem -noout -text | grep DNS | sed -e 's/  *//g' -e 's/DNS://g'`,$1"
+
+echo "Requesting certificate for domains: '$domains'"
+certbot certonly --expand --apache --must-staple --hsts --domains=$domains
+
-- 
GitLab