fix(lego): do not trigger script abortion on wanted exit code != 0

This commit is contained in:
transcaffeine 2025-05-01 13:51:33 +02:00
parent b14f36c7e8
commit 27d9555428
Signed by: transcaffeine
GPG Key ID: 03624C433676E465

View File

@ -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