Cert expiration check from dns zone file
Jump to navigation
Jump to search
Tool
https://github.com/genkiroid/cert
https://github.com/genkiroid/cert/releases
git clone https://github.com/genkiroid/cert cd cmd/cert go build -o cert if you want to build it from source using golang
#!/bin/bash
# DNS zone files must be in $domain.zone file format
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <domain>"
echo "Example: $0 mktp.io"
exit
fi
domain=$1
sleep_seconds=0
for i in $(sed '/; Zone records/,$!d' ${domain}.zone | sed '1,4d' | awk '{print $1}'); do
fqdns="${fqdns} ${i}.${domain}"
sleep ${sleep_seconds}
done
cert $fqdns