Skip to content

Commit

Permalink
Switched from pgrep to pidof
Browse files Browse the repository at this point in the history
  • Loading branch information
Dashboy1998 committed Feb 23, 2024
1 parent b2deb3a commit 755cb42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/player_logging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ get_playername(){
}

while true; do
mapfile -t server_pids < <(pgrep PalServer-Linux)
if [ "${#server_pids[@]}" -ne 0 ]; then
server_pid=$(pidof PalServer-Linux-Test)
if [ -n "${server_pid}" ]; then
# Player IDs are usally 9 or 10 digits however when a player joins for the first time for a given boot their ID is temporary 00000000 (8x zeros) while loading
# Player ID is also 00000000 (8x zeros) when in character creation
mapfile -t current_player_list < <( get_players_list | tail -n +2 | sed '/,00000000,[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]/d' | sort )
Expand Down

0 comments on commit 755cb42

Please sign in to comment.