Add rcon client to container

This commit is contained in:
Tobias Tangemann
2024-11-10 18:47:06 +01:00
parent 2092e86aec
commit 374f7c8249
4 changed files with 251 additions and 1 deletions

11
docker/files/players-online.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
PLAYERS=$(docker exec xenodochial_spence rcon /players)
ONLINE_COUNT=$(echo "$PLAYERS" | grep -c " (online)$")
if [[ "$ONLINE_COUNT" -gt "0" ]]; then
echo "$PLAYERS"
# exit with 75 (EX_TEMPFAIL) for watchtower
# https://containrrr.dev/watchtower/lifecycle-hooks/
exit 75
fi