/scripts/alcasar-importcert.sh |
---|
54,15 → 54,13 |
function domainName() # change the domain name in the conf files |
{ |
fqdn=$(openssl x509 -noout -subject -in $cert | sed -n '/^subject/s/^.*CN=//p' | cut -d'/' -f 1) |
#check if there is a wildcard in $fqdn |
mystar='*' |
if [[ $fqdn == *"${mystar}"* ]]; |
if [[ $fqdn == *"*"* ]]; |
then |
hostname="alcasar" |
fqdn=${fqdn/$mystar/$hostname} |
fqdn=${fqdn/"*"/$hostname} |
else |
hostname=`echo $fqdn | awk -F'.' '{ print $1 }'` |
fi |