Add timeout to nc in teamspeak-fallback

This commit is contained in:
Tobias Reisinger 2024-02-16 00:09:32 +01:00
parent ca0e40d0dd
commit d42865d3f3
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE

View file

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