Change curl to nc to check tcp port (#111)

This commit is contained in:
Leendert de Borst
2024-07-19 20:46:35 +02:00
parent a639a2581a
commit 4c15d64ece

View File

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