Skip to content

Commit

Permalink
Merge pull request #436 from Dashboy1998/Fix-waiting-for-palworld-to-…
Browse files Browse the repository at this point in the history
…exit-in-restore

Switch to pidof in restore
  • Loading branch information
thijsvanloef committed Feb 23, 2024
2 parents acd6d65 + 091111c commit 8d507a8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,12 @@ 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 /dev/null
fi
LogSuccess "Shutdown Complete"
LogSuccess "Shutdown Complete"

trap - ERR

Expand Down

0 comments on commit 8d507a8

Please sign in to comment.