Skip to content

Commit

Permalink
start player polling after rcon is up
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsvanloef committed Feb 26, 2024
1 parent 895cab7 commit 640d7c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gettext-base=0.21-12 \
xdg-user-dirs=0.18-1 \
jo=1.9-1 \
netcat-traditional=1.10-47 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
6 changes: 6 additions & 0 deletions scripts/player_logging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ get_playername(){
echo "${player_info}" | sed -E 's/,([0-9]+),[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]//g'
}

# Wait until rcon port is open
while ! nc -z 127.0.0.1 "${RCON_PORT}"; do
sleep 5
LogInfo "Waiting for RCON port to open to show player logging..."
done

while true; do
server_pid=$(pidof PalServer-Linux-Test)
if [ -n "${server_pid}" ]; then
Expand Down

0 comments on commit 640d7c1

Please sign in to comment.