From cfdee03ab7c3500ce887bd84e513e2c31460ddb0 Mon Sep 17 00:00:00 2001 From: "Gaunt, John" Date: Sun, 7 Jan 2018 21:35:42 -0500 Subject: [PATCH] Update csr.sh --- csr.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/csr.sh b/csr.sh index 38aa132..b3e9ff9 100644 --- a/csr.sh +++ b/csr.sh @@ -1,8 +1,14 @@ #!/bin/bash -HOSTNAME=$1 -DOMAIN="home.johnhagunt.com" -#read -p 'Hostname: ' hostname + +if [ $# -eq 0 ]; then + read -p 'Please enter a Hostname: ' HOSTNAME +elif [ $# -gt 0 ]; then + # do something more here +else + HOSTNAME=$1 +fi +DOMAIN="home.johnhagunt.com" openssl req -new -sha512 -nodes -out $HOSTNAME.$DOMAIN.csr -newkey rsa:4096 -keyout $HOSTNAME.$DOMAIN.key -config <( cat <<-EOF