factorio-docker/docker/files/players-online.sh

12 lines
289 B
Bash
Raw Normal View History

2024-11-10 18:47:06 +01:00
#!/bin/bash
2024-11-10 19:00:31 +01:00
PLAYERS=$(rcon /players)
2024-11-10 18:47:06 +01:00
ONLINE_COUNT=$(echo "$PLAYERS" | grep -c " (online)$")
if [[ "$ONLINE_COUNT" -gt "0" ]]; then
echo "$PLAYERS"
2024-11-13 22:47:55 +01:00
# exit with 75 (EX_TEMPFAIL) so watchtower skips the update
2024-11-10 18:47:06 +01:00
# https://containrrr.dev/watchtower/lifecycle-hooks/
exit 75
fi