clean up output

This commit is contained in:
Matthew Saunders Brown 2023-02-16 09:27:01 -08:00
parent c03101aa08
commit f7fab10594

View File

@ -43,20 +43,21 @@ fi
cd /etc/ssl/dkim
date +%Y%m%d > $domain.selector
openssl genrsa -out $domain.pem 2048
openssl rsa -in $domain.pem -out $domain.pub -pubout
openssl genrsa -out $domain.pem 2048 2> /dev/null
openssl rsa -in $domain.pem -out $domain.pub -pubout 2> /dev/null
tail -n +2 $domain.pub |head -n -1|tr -d '\n' > $domain.dkim
echo `cat $domain.selector`._domainkey.$domain 3600 IN TXT \""k=rsa; p=`cat $domain.dkim`"\" > $domain.dns
chown Debian-exim:ssl-cert $domain.*
echo
echo Create this dns record:
echo
cat $domain.dns
if [[ -f /usr/local/etc/pdns.conf ]]; then
dnsname=`cat /etc/ssl/dkim/$domain.selector`
dnsname="$dnsname._domainkey.$domain"
dnsrecord=`cat /etc/ssl/dkim/$domain.dkim`
dnsrecord="k=rsa; p=$dnsrecord"
echo pdns-rr-rep.sh -z $domain -n $dnsname -t TXT -r \'$dnsrecord\'
exit
else
echo Create this dns record:
echo
echo Looks like you have powerdns-tools enabled, you can simply run this:
echo
echo pdns-rr-rep.sh -z $domain -n `cat $domain.selector`._domainkey.$domain -t TXT -r \'k=rsa\; p=`cat $domain.dkim`\'
echo
cat $domain.dns
fi