From 5c1ac15c0f91a7c0f06ce7e09a318691229f7f24 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Thu, 22 Feb 2024 20:57:30 -0500 Subject: [PATCH 1/3] Switch to pidof in restore --- scripts/restore.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/restore.sh b/scripts/restore.sh index 792487fd..072b63b4 100644 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -69,12 +69,10 @@ if [ -f "$BACKUP_FILE" ]; then exit 1 fi - mapfile -t server_pids < <(pgrep PalServer-Linux-Test) - if [ "${#server_pids[@]}" -ne 0 ]; then + server_pid=$(pidof PalServer-Linux-Test) + if [ -n "${server_pid}" ]; then LogInfo "Waiting for Palworld to exit.." - for pid in "${server_pids[@]}"; do - tail --pid="$pid" -f 2>/dev/null - done + tail --pid="${server_pid}" -f 2>/dev/null fi LogSuccess "Shutdown Complete" From 2d02b564789dcabba5c434f54745bb28c5e25523 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Thu, 22 Feb 2024 21:35:44 -0500 Subject: [PATCH 2/3] Updated redirect --- scripts/restore.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore.sh b/scripts/restore.sh index 072b63b4..6ab36f29 100644 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -72,7 +72,7 @@ if [ -f "$BACKUP_FILE" ]; then server_pid=$(pidof PalServer-Linux-Test) if [ -n "${server_pid}" ]; then LogInfo "Waiting for Palworld to exit.." - tail --pid="${server_pid}" -f 2>/dev/null + tail --pid="${server_pid}" -f /dev/null fi LogSuccess "Shutdown Complete" From 091111cbfbc78c561048cfa0d5e868a5043894c7 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Thu, 22 Feb 2024 21:41:43 -0500 Subject: [PATCH 3/3] Fixed spacing issue --- scripts/restore.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore.sh b/scripts/restore.sh index 6ab36f29..87fd3be3 100644 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -74,7 +74,7 @@ if [ -f "$BACKUP_FILE" ]; then LogInfo "Waiting for Palworld to exit.." tail --pid="${server_pid}" -f /dev/null fi - LogSuccess "Shutdown Complete" + LogSuccess "Shutdown Complete" trap - ERR