From d0ade80f1906990b7b0639a2649f33ac059b75d5 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 (cherry picked from commit f2ee49abe485259de55377333e20f5d369aa08d9) --- 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