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