From b36fc5225b192c5c3f6d1bbdf4b21a2780f2fcd3 Mon Sep 17 00:00:00 2001 From: "Gaunt, John" Date: Sat, 6 Jan 2018 22:04:09 -0500 Subject: [PATCH] Update csr.sh --- csr.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/csr.sh b/csr.sh index 0f2f0fa..38aa132 100644 --- a/csr.sh +++ b/csr.sh @@ -1,7 +1,10 @@ #!/bin/bash -URL=$1 +HOSTNAME=$1 +DOMAIN="home.johnhagunt.com" -openssl req -new -sha512 -nodes -out $URL.ad.johnhgaunt.com.csr -newkey rsa:4096 -keyout $URL.ad.johnhgaunt.com.key -config <( +#read -p 'Hostname: ' hostname + +openssl req -new -sha512 -nodes -out $HOSTNAME.$DOMAIN.csr -newkey rsa:4096 -keyout $HOSTNAME.$DOMAIN.key -config <( cat <<-EOF [req] default_bits = 4096 @@ -17,13 +20,13 @@ L=Pittsburgh O=Gaunt OU=Gaunt emailAddress=admin@johnhgaunt.com -CN=$URL.ad.johnhgaunt.com +CN=$HOSTNAME.$DOMAIN [ req_ext ] subjectAltName = @alt_names [ alt_names ] -DNS.1 = $URL.ad.johnhgaunt.com -DNS.2 = $URL +DNS.1 = $HOSTNAME.$DOMAIN +DNS.2 = $HOSTNAME EOF ) \ No newline at end of file