From 27d95554288da12452942eed0209c128c866e5d3 Mon Sep 17 00:00:00 2001 From: transcaffeine Date: Thu, 1 May 2025 13:51:33 +0200 Subject: [PATCH] fix(lego): do not trigger script abortion on wanted exit code != 0 --- roles/lego/files/lego_run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/lego/files/lego_run.sh b/roles/lego/files/lego_run.sh index 63be0e8..5da78bf 100644 --- a/roles/lego/files/lego_run.sh +++ b/roles/lego/files/lego_run.sh @@ -8,8 +8,8 @@ if [[ -n "${LEGO_HTTP_FALLBACK_PORT:-}" ]]; then echo "nc not found (in PATH), exiting" exit 1 fi - nc -z 127.0.0.1 $LEGO_HTTP_PORT; - if [[ $? -eq 0 ]]; then + nc_exit_code=$(nc -z 127.0.0.1 $LEGO_HTTP_PORT); + if [[ $nc_exit_code -eq 0 ]]; then LEGO_HTTP_PORT=$LEGO_HTTP_FALLBACK_PORT fi fi