From 4c15d64ece8d6215b40e5bae171c75618982091d Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Fri, 19 Jul 2024 20:46:35 +0200 Subject: [PATCH] Change curl to nc to check tcp port (#111) --- .github/workflows/docker-compose-build.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-compose-build.yml b/.github/workflows/docker-compose-build.yml index 6f91c3f17..9e3d0a6fa 100644 --- a/.github/workflows/docker-compose-build.yml +++ b/.github/workflows/docker-compose-build.yml @@ -50,11 +50,10 @@ jobs: fi - name: Test if localhost:2525 (SmtpService) responds run: | - # Test if the service on localhost:2525 responds - response=$(curl -s --connect-timeout 5 localhost:2525) - if [ -z "$response" ]; then - echo "SmtpService did not respond on port 2525. Check if the SmtpService service is running." - exit 1 - else - echo "SmtpService responded on port 2525" - fi + # Test if the service on localhost:2525 responds + if nc -zv localhost 2525 2>&1 | grep -q 'succeeded'; then + echo "SmtpService did not respond on port 2525. Check if the SmtpService service is running." + exit 1 + else + echo "SmtpService responded on port 2525" + fi