diff --git a/scripts/get-domains-from-cert.sh b/scripts/get-domains-from-cert.sh new file mode 100644 index 0000000..04b47af --- /dev/null +++ b/scripts/get-domains-from-cert.sh @@ -0,0 +1,11 @@ +#!/bin/sh +#!/bin/sh + +# Check for the presence of the certificate file +if [ ! -f "$1" ]; then + exit 0 +fi + +# Extract subjectAltName from the certificate +openssl x509 -in "$1" -text -noout | grep -E -o "DNS:[^,]*" | sed 's/DNS://g' | tr -d ' ' | tr ',' ' ' | sort | tr '\n' ' ' +