#!/bin/bash if [ "$1" = "" ]; then echo 'Exit. Your must enter hostname (CN) !' exit 1 fi #cd /home/agm/ssl/ HOST_NAME="$1" SUBJECT="/C=CA/ST=ON/L=Barrie/O=AG-NAV Inc./OU=SD/CN=$HOST_NAME/emailAddress=software@agnav.com" openssl req -new -nodes -newkey rsa:2048 -subj "$SUBJECT" -keyout $HOST_NAME.key -out $HOST_NAME.csr