enable verbose mode

This commit is contained in:
Matthew Saunders Brown 2023-10-10 13:16:57 -07:00
parent 13b930de0a
commit 23b2087d07

View File

@ -15,10 +15,11 @@ help()
echo "$thisfilename" echo "$thisfilename"
echo "Remove DKIM key(s) from server for specified domain." echo "Remove DKIM key(s) from server for specified domain."
echo "" echo ""
echo "usage: $thisfilename -d <domain> [-h]" echo "usage: $thisfilename -d <domain> [-v] [-h]"
echo "" echo ""
echo " -h Print this help." echo " -h Print this help."
echo " -d Domain name to remove DKIM keys for." echo " -d Domain name to remove DKIM keys for."
echo " -v Verbose - output instructions regarding DNS."
echo "" echo ""
echo " DKIM key for the specified domain is removed from the server and" echo " DKIM key for the specified domain is removed from the server and"
echo " outgoing emails will no longer be signed with DKIM. You should also" echo " outgoing emails will no longer be signed with DKIM. You should also"
@ -41,20 +42,22 @@ if [ ! -f /etc/ssl/dkim/$domain.dkim ]; then
exit 1 exit 1
else else
if [[ -f /etc/ssl/dkim/$domain.selector ]]; then if [[ -f /etc/ssl/dkim/$domain.selector ]]; then
echo Deleting the `cat /etc/ssl/dkim/$domain.selector`._domainkey.$domain DKIM key. if [[ -n $verbose ]]; then
if [[ -f /usr/local/etc/pdns.conf ]]; then if [[ -f /usr/local/etc/pdns.conf ]]; then
echo To remove the associated DNS record run this command: echo To remove the associated DNS record run this command:
echo echo
echo pdns-rr-del.sh -z $domain -n `cat /etc/ssl/dkim/$domain.selector`._domainkey.$domain -t TXT echo pdns-rr-del.sh -z $domain -n `cat /etc/ssl/dkim/$domain.selector`._domainkey.$domain -t TXT
else else
echo You can now delete the DNS TXT record for `cat /etc/ssl/dkim/$domain.selector`._domainkey.$domain echo You can now delete the DNS TXT record for `cat /etc/ssl/dkim/$domain.selector`._domainkey.$domain
fi
fi fi
else rm /etc/ssl/dkim/$domain.selector
echo You can now delete the associated DNS TXT record.
fi fi
rm /etc/ssl/dkim/$domain.dkim
fi fi
if [ -f /etc/ssl/dkim/$domain.dkim ]; then
rm /etc/ssl/dkim/$domain.dkim
fi
if [ -f /etc/ssl/dkim/$domain.dns ]; then if [ -f /etc/ssl/dkim/$domain.dns ]; then
rm /etc/ssl/dkim/$domain.dns rm /etc/ssl/dkim/$domain.dns
fi fi
@ -64,6 +67,4 @@ fi
if [ -f /etc/ssl/dkim/$domain.pub ]; then if [ -f /etc/ssl/dkim/$domain.pub ]; then
rm /etc/ssl/dkim/$domain.pub rm /etc/ssl/dkim/$domain.pub
fi fi
if [ -f /etc/ssl/dkim/$domain.selector ]; then
rm /etc/ssl/dkim/$domain.selector
fi