From d42865d3f3213185981e0d3ea7d62c14a6b03de8 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Fri, 16 Feb 2024 00:09:32 +0100 Subject: [PATCH] Add timeout to nc in teamspeak-fallback --- roles/teamspeak_fallback/templates/conditional-start.sh.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/teamspeak_fallback/templates/conditional-start.sh.j2 b/roles/teamspeak_fallback/templates/conditional-start.sh.j2 index f0ac6a6..e06184a 100644 --- a/roles/teamspeak_fallback/templates/conditional-start.sh.j2 +++ b/roles/teamspeak_fallback/templates/conditional-start.sh.j2 @@ -2,7 +2,7 @@ while true do - if nc -z "{{ teamspeak_fallback_check_server }}" "{{ teamspeak_fallback_check_port }}" + if nc -z -w 3 "{{ teamspeak_fallback_check_server }}" "{{ teamspeak_fallback_check_port }}" then if docker compose ps --services | grep teamspeak >/dev/null; then echo "Stopping Server" @@ -14,5 +14,5 @@ do docker compose up -d --pull=always fi fi - sleep 5 + sleep 2 done