#!/bin/sh set -eu umask 077 certbot certificates 2> /dev/null | awk ' { if (/^ Certificate Name: /) { cert = $3 } if (/^ Expiry Date: /) { days = $6 if (days < 30) { print cert " " days " days" } } } '