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
domains=/tmp/domains
fail() {
echo ${1:-1} >> "${failed}"
}
ok() {
echo "ok - $@" >&2
}
not_ok() {
echo "not ok - $@" >&2
touch "${failed}"
fail 1
}
domain_configured() {
@ -198,12 +202,12 @@ case $1 in
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"
touch "${failed}"
fail 255
done
esac
if test -f "${failed}" ; then
ensure 255
ensure `sort -hr ${failed} | head -n 1`
else
ensure 0
fi