18 lines
412 B
Django/Jinja
18 lines
412 B
Django/Jinja
#!/usr/bin/env sh
|
|
|
|
while true
|
|
do
|
|
if nc -z "{{ teamspeak_fallback_check_server }}" "{{ teamspeak_fallback_check_port }}"
|
|
then
|
|
if docker compose ps --services | grep teamspeak >/dev/null; then
|
|
echo "Stopping Server"
|
|
docker compose down
|
|
fi
|
|
else
|
|
if ! docker compose ps --services | grep teamspeak >/dev/null; then
|
|
echo "Starting Server"
|
|
docker compose up -d --pull=always
|
|
fi
|
|
fi
|
|
sleep 5
|
|
done
|