Migrate services part
This commit is contained in:
parent
7c59e4ae57
commit
73bce8f6e5
157 changed files with 3883 additions and 9 deletions
18
roles/teamspeak_fallback/templates/conditional-start.sh.j2
Normal file
18
roles/teamspeak_fallback/templates/conditional-start.sh.j2
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
while true
|
||||
do
|
||||
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"
|
||||
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 2
|
||||
done
|
||||
Loading…
Reference in a new issue