From 32e91c13a7eaeb42cd1250de5e60bd400c60e4be Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Wed, 4 Jun 2025 09:00:08 +0100 Subject: lfacme-renew: use correct exit status --- lfacme-renew.sh | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/lfacme-renew.sh b/lfacme-renew.sh index 5dc0619..0dc0392 100644 --- a/lfacme-renew.sh +++ b/lfacme-renew.sh @@ -173,7 +173,7 @@ _docert() { # make sure the challenge is valid. challenge_path="$(_findchallenge "$identifier" "$challenge")" - if [ "$?" -ne 0 ]; then + if [ -z "$challenge_path" ]; then return 1 fi @@ -183,7 +183,7 @@ _docert() { local _rhooks="" for hook in $hooks; do local _hookpath="$(_findhook "$identifier" "$hook")" - if [ "$?" -ne 0 ]; then + if [ -z "$_hookpath" ]; then return 1 fi @@ -246,21 +246,24 @@ _docert() { return $? } -_exit=0 -_default_args="" - cat "$_DOMAINS" \ | egrep -v '^(#|[[:space:]]*$)' \ -| while read identifier args; do +| ( + _default_args="" + _exit=0 + + while read identifier args; do + if [ "$identifier" = "*" ]; then + _default_args="$args" + continue + fi - if [ "$identifier" = "*" ]; then - _default_args="$args" - continue - fi + if ! _docert "$identifier" $_default_args $args; then + _exit=1 + fi + done - if ! _docert "$identifier" $_default_args $args; then - _exit=1 - fi -done + exit $_exit +) -exit $_exit +exit $? -- cgit v1.2.3