Skip to content

Commit b67f20d

Browse files
committed
server pid helper
1 parent 7cb5859 commit b67f20d

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

lib/dump_memory.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fi
99

1010
source lib/lib.sh
1111

12-
server_pid="$(pgrep -f "sid:$SERVER_UUID")"
12+
server_pid="$(get_server_pid)"
1313

1414
if [ "$server_pid" = "" ]
1515
then

lib/lib.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ function is_running_loop() {
3434
return 1
3535
}
3636

37+
get_server_pid() {
38+
# all main server processes should use the sid: prefix
39+
# side runners also use the SERVER_UUID but not the sid: prefix
40+
pgrep -f "sid:$SERVER_UUID"
41+
}
42+
3743
function get_player_ips() {
3844
if [ ! "$(command -v rg)" ]
3945
then

0 commit comments

Comments
 (0)