#!/bin/rc -e # This script utilizes lscert and rmcert to # remove all but the most recent selector # Despite other scripts supporting arbitrary selectors, # this script enforces a # YYYYMMDD format for selectors. # Check format for (s in `{dkim/lscert}) { echo $s | grep -E '^[0-9]{8}$' >/dev/null } old = `{dkim/lscert | sort -r | tail -n +2} for (s in $old) { echo RMCERT $s dkim/rmcert $s }