diff --git a/expandCertbot.sh b/expandCertbot.sh new file mode 100644 index 0000000000000000000000000000000000000000..98d9d8d571a0c68e5ff5895cc4a25815c6ec579d --- /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 +