fix: fail with highest error

This commit is contained in:
f 2024-12-28 17:53:26 -03:00
parent 0e6d890ee9
commit d92d09d04f
No known key found for this signature in database

View file

@ -5,13 +5,17 @@ updated=/tmp/certbot.updated
failed=/tmp/certbot.failed failed=/tmp/certbot.failed
domains=/tmp/domains domains=/tmp/domains
fail() {
echo ${1:-1} >> "${failed}"
}
ok() { ok() {
echo "ok - $@" >&2 echo "ok - $@" >&2
} }
not_ok() { not_ok() {
echo "not ok - $@" >&2 echo "not ok - $@" >&2
touch "${failed}" fail 1
} }
domain_configured() { domain_configured() {
@ -198,12 +202,12 @@ case $1 in
find /etc/letsencrypt/renewal/ -name "*-001.conf" | while read broken_renewal; do find /etc/letsencrypt/renewal/ -name "*-001.conf" | while read broken_renewal; do
not_ok "${broken_renewal} certbot found an inconsistency on certificates and decided to create a new one" not_ok "${broken_renewal} certbot found an inconsistency on certificates and decided to create a new one"
touch "${failed}" fail 255
done done
esac esac
if test -f "${failed}" ; then if test -f "${failed}" ; then
ensure 255 ensure `sort -hr ${failed} | head -n 1`
else else
ensure 0 ensure 0
fi fi