TYPE="altname3"
CTYPE="altname"
- create_cert $CERT_DIR/${catype}_${TYPE}_2 "$catype altname without hosname/CN=$hostname_full" ${TYPE} $DAYS
+ create_cert $CERT_DIR/${catype}_${TYPE}_2 "$catype altname without hostname/CN=$hostname_full" ${TYPE} $DAYS
TYPE="server"
CTYPE="server2"
#get full hostname
hostname_space=`hostname -A 2>/dev/null || hostname -f`
-#remove trailing space
-hostname_full=`echo $hostname_space`
+#remove trailing space, take fist one if there are aliases
+hostname_full=`echo $hostname_space | awk '{print $1}'`
echo host name is [$hostname_full]
export DNS_HOSTNAME=DNS:$hostname_full