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